[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r5476 - glibc-package/branches/eglibc-2.17/debian/patches/any



Author: adconrad
Date: 2013-02-04 02:53:34 +0000 (Mon, 04 Feb 2013)
New Revision: 5476

Modified:
   glibc-package/branches/eglibc-2.17/debian/patches/any/unsubmitted-cloexec-conditional.diff
Log:
Add libio/fileops.c fix to unsubmitted-cloexec-conditional.diff

Modified: glibc-package/branches/eglibc-2.17/debian/patches/any/unsubmitted-cloexec-conditional.diff
===================================================================
--- glibc-package/branches/eglibc-2.17/debian/patches/any/unsubmitted-cloexec-conditional.diff	2013-02-04 02:18:11 UTC (rev 5475)
+++ glibc-package/branches/eglibc-2.17/debian/patches/any/unsubmitted-cloexec-conditional.diff	2013-02-04 02:53:34 UTC (rev 5476)
@@ -1,3 +1,39 @@
+diff --git a/libio/fileops.c b/libio/fileops.c
+index 61b61b3..80767f5 100644
+--- a/libio/fileops.c
++++ b/libio/fileops.c
+@@ -335,16 +335,24 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
+   if (result != NULL)
+     {
+ #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)
++# ifdef O_CLOEXEC
++      if (__have_o_cloexec <= 0)
++# endif
++        {
++	  if ((fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0)
+ 	    {
++	      int fd = _IO_fileno (fp);
+ 	      int flags = __fcntl (fd, F_GETFD);
+-	      __have_o_cloexec = (flags & FD_CLOEXEC) == 0 ? -1 : 1;
++# ifdef O_CLOEXEC
++	      if (__have_o_cloexec == 0)
++		__have_o_cloexec = (flags & FD_CLOEXEC) == 0 ? -1 : 1;
++	      if (__have_o_cloexec < 0)
++# endif
++		{
++		  flags |= FD_CLOEXEC;
++		  __fcntl (fd, F_SETFD, flags);
++		}
+ 	    }
+-	  if (__have_o_cloexec < 0)
+-	    __fcntl (fd, F_SETFD, FD_CLOEXEC);
+ 	}
+ #endif
+ 
 diff --git a/locale/loadarchive.c b/locale/loadarchive.c
 index dd70c15..4edb03e 100644
 --- a/locale/loadarchive.c


Reply to: