diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2001-02-21 23:11:06 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2001-02-21 23:11:06 +0000 |
commit | 3a8fc0e4f13f940839c1e25818eac3f7860d3fe8 (patch) | |
tree | 51d679bf085aa3d8e9fcbbc6ff75a391593caa29 /newlib/libc/stdio/fdopen.c | |
parent | fc168ded9e8b654ceffa8990e6abd97614b5a9e6 (diff) | |
download | cygnal-3a8fc0e4f13f940839c1e25818eac3f7860d3fe8.tar.gz cygnal-3a8fc0e4f13f940839c1e25818eac3f7860d3fe8.tar.bz2 cygnal-3a8fc0e4f13f940839c1e25818eac3f7860d3fe8.zip |
2001-02-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/fdopen.c (fdopen): Protect calls to _fcntl() with
HAVE_FCNTL flag check.
* configure.host: Define HAVE_FCNTL for Cygwin, go32, RTEMS, sparc64,
powerpcle, x86 netware, x86 sco, x86 Linux and Vxworks.
Diffstat (limited to 'newlib/libc/stdio/fdopen.c')
-rw-r--r-- | newlib/libc/stdio/fdopen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdio/fdopen.c b/newlib/libc/stdio/fdopen.c index 410a5248a..bd4018b69 100644 --- a/newlib/libc/stdio/fdopen.c +++ b/newlib/libc/stdio/fdopen.c @@ -55,7 +55,7 @@ _DEFUN (_fdopen_r, (ptr, fd, mode), { register FILE *fp; int flags, oflags; -#ifdef F_GETFL +#ifdef HAVE_FCNTL int fdflags, fdmode; #endif @@ -63,7 +63,7 @@ _DEFUN (_fdopen_r, (ptr, fd, mode), return 0; /* make sure the mode the user wants is a subset of the actual mode */ -#ifdef F_GETFL +#ifdef HAVE_FCNTL if ((fdflags = _fcntl (fd, F_GETFL, 0)) < 0) return 0; fdmode = fdflags & O_ACCMODE; @@ -83,7 +83,7 @@ _DEFUN (_fdopen_r, (ptr, fd, mode), * __swrite() will lseek to end before each write. */ if ((oflags & O_APPEND) -#ifdef F_GETFL +#ifdef HAVE_FCNTL && !(fdflags & O_APPEND) #endif ) |