1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- fpathconf() should work with the stdio streams, even in the thread-safe

library version, again.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15133 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2006-09-17 16:36:48 +00:00
parent 42dba39aef
commit 8aeb5072ab
2 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,6 @@
- fpathconf() should work with the stdio streams, even in the thread-safe
library version, again.
- Updated m68k specs file in /documentation to contain an own __CLIB2__ - Updated m68k specs file in /documentation to contain an own __CLIB2__
define so that existing m68k compilers also have this define. In addition, define so that existing m68k compilers also have this define. In addition,
the common "-noixemul" option can now also be specified but will do a NOP the common "-noixemul" option can now also be specified but will do a NOP

View File

@ -1,5 +1,5 @@
/* /*
* $Id: unistd_fpathconf.c,v 1.2 2006-09-12 14:16:44 obarthel Exp $ * $Id: unistd_fpathconf.c,v 1.3 2006-09-17 16:36:48 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@ -51,6 +51,8 @@ long
fpathconf(int file_descriptor,int name) fpathconf(int file_descriptor,int name)
{ {
struct FileHandle *fh; struct FileHandle *fh;
BPTR default_file;
int error = 0;
long ret = -1; long ret = -1;
struct fd *fd; struct fd *fd;
@ -59,22 +61,29 @@ fpathconf(int file_descriptor,int name)
fd = __get_file_descriptor(file_descriptor); fd = __get_file_descriptor(file_descriptor);
if(fd == NULL) if(fd == NULL)
{ {
__set_errno(EINVAL); error = EINVAL;
goto out; goto out;
} }
if(FLAG_IS_SET(fd->fd_Flags,FDF_STDIO) || FLAG_IS_SET(fd->fd_Flags,FDF_IS_SOCKET)) if(FLAG_IS_SET(fd->fd_Flags,FDF_IS_SOCKET))
{ {
__set_errno(EBADF); error = EBADF;
goto out; goto out;
} }
fh = BADDR(fd->fd_DefaultFile); error = __get_default_file(file_descriptor,&default_file);
if(error != 0)
goto out;
ret = __pathconf(fh->fh_Type,name); /* Ok if fh->fh_Type==NULL */ fh = BADDR(default_file);
ret = __pathconf(fh->fh_Type,name);
out: out:
if(ret == -1 && error != 0)
__set_errno(error);
RETURN(ret); RETURN(ret);
return(ret); return(ret);
} }