aboutsummaryrefslogtreecommitdiff
path: root/libio/oldiofdopen.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-08-31 14:07:23 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-08-31 14:48:25 +0200
commit5f0704b66cea73cf2ab148ec4cff645cc301fd8c (patch)
tree13817263f75cf2e72b3bc0ce9abafa4b9b7398e8 /libio/oldiofdopen.c
parent5129873a8e913e207e5f7b4b521c72f41a1bbf6d (diff)
downloadglibc-5f0704b66cea73cf2ab148ec4cff645cc301fd8c.tar
glibc-5f0704b66cea73cf2ab148ec4cff645cc301fd8c.tar.gz
glibc-5f0704b66cea73cf2ab148ec4cff645cc301fd8c.tar.bz2
glibc-5f0704b66cea73cf2ab148ec4cff645cc301fd8c.zip
libio: Assume _LIBC, weak_alias, errno, (__set_)errno &c are defined
Do not define _POSIX_SOURCE.
Diffstat (limited to 'libio/oldiofdopen.c')
-rw-r--r--libio/oldiofdopen.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/libio/oldiofdopen.c b/libio/oldiofdopen.c
index 7f6180767e..42284263ba 100644
--- a/libio/oldiofdopen.c
+++ b/libio/oldiofdopen.c
@@ -32,10 +32,6 @@
#include "libioP.h"
#include <fcntl.h>
-#ifndef _IO_fcntl
-# define _IO_fcntl __fcntl
-#endif
-
_IO_FILE *
attribute_compat_text_section
_IO_old_fdopen (int fd, const char *mode)
@@ -69,11 +65,7 @@ _IO_old_fdopen (int fd, const char *mode)
}
if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
read_write &= _IO_IS_APPENDING;
-#ifdef F_GETFL
- fd_flags = _IO_fcntl (fd, F_GETFL);
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-#endif
+ fd_flags = __fcntl (fd, F_GETFL);
if (fd_flags == -1
|| ((fd_flags & O_ACCMODE) == O_RDONLY && !(read_write & _IO_NO_WRITES))
|| ((fd_flags & O_ACCMODE) == O_WRONLY && !(read_write & _IO_NO_READS)))
@@ -97,12 +89,9 @@ _IO_old_fdopen (int fd, const char *mode)
*/
if ((posix_mode & O_APPEND) && !(fd_flags & O_APPEND))
{
-#ifdef F_SETFL
- if (_IO_fcntl (fd, F_SETFL, fd_flags | O_APPEND) == -1)
-#endif
+ if (__fcntl (fd, F_SETFL, fd_flags | O_APPEND) == -1)
return NULL;
}
-#endif
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)