This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix _IO_new_file_fopen build


Hi,

_IO_new_file_fopen won't build if __ASSUME_O_CLOEXEC is undefined.
This patch fixes it.


H.J.
---
2011-05-16  H.J. Lu  <hongjiu.lu@intel.com>

	*  fileops.c (_IO_new_file_fopen): Get fd from _IO_fileno.

diff --git a/libio/fileops.c b/libio/fileops.c
index 2b696ab..30de460 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -348,6 +348,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
 #ifndef __ASSUME_O_CLOEXEC
   if ((fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0 && __have_o_cloexec <= 0)
     {
+      int fd = _IO_fileno (fp);
       if (__have_o_cloexec == 0)
 	{
 	  int flags = __fcntl (fd, F_GETFD);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]