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

r3256 - in glibc-package/branches/glibc-2.9/debian: . patches patches/hurd-i386



Author: sthibaul-guest
Date: 2009-01-27 21:23:18 +0000 (Tue, 27 Jan 2009)
New Revision: 3256

Added:
   glibc-package/branches/glibc-2.9/debian/patches/hurd-i386/submitted-dup2-fix.diff
Modified:
   glibc-package/branches/glibc-2.9/debian/changelog
   glibc-package/branches/glibc-2.9/debian/patches/series
Log:
  * hurd-i386/submitted-dup2-fix.diff: new patch to fix dup2 FD locking.


Modified: glibc-package/branches/glibc-2.9/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.9/debian/changelog	2009-01-27 21:20:22 UTC (rev 3255)
+++ glibc-package/branches/glibc-2.9/debian/changelog	2009-01-27 21:23:18 UTC (rev 3256)
@@ -100,6 +100,7 @@
   * hurd-i386/cvs-report-wait-fix.diff: new patch to fix report-wait crash.
   * hurd-i386/submitted-critical-sections.diff: new patch to fix some missing
     critical sections.
+  * hurd-i386/submitted-dup2-fix.diff: new patch to fix dup2 FD locking.
 
  -- Aurelien Jarno <aurel32@debian.org>  Sun, 25 Jan 2009 11:14:06 +0100
 

Added: glibc-package/branches/glibc-2.9/debian/patches/hurd-i386/submitted-dup2-fix.diff
===================================================================
--- glibc-package/branches/glibc-2.9/debian/patches/hurd-i386/submitted-dup2-fix.diff	                        (rev 0)
+++ glibc-package/branches/glibc-2.9/debian/patches/hurd-i386/submitted-dup2-fix.diff	2009-01-27 21:23:18 UTC (rev 3256)
@@ -0,0 +1,41 @@
+Index: glibc/sysdeps/mach/hurd/dup2.c
+===================================================================
+RCS file: /cvs/glibc/libc/sysdeps/mach/hurd/dup2.c,v
+retrieving revision 1.20
+diff -u -p -r1.20 dup2.c
+--- glibc/sysdeps/mach/hurd/dup2.c	3 Aug 2002 06:46:57 -0000	1.20
++++ glibc/sysdeps/mach/hurd/dup2.c	27 Jan 2009 21:15:36 -0000
+@@ -68,15 +68,14 @@ __dup2 (fd, fd2)
+ 	  /* Get a hold of the destination descriptor.  */
+ 	  struct hurd_fd *d2;
+ 
++	  __mutex_lock (&_hurd_dtable_lock);
++
+ 	  if (fd2 >= _hurd_dtablesize)
+ 	    {
+ 	      /* The table is not large enough to hold the destination
+ 		 descriptor.  Enlarge it as necessary to allocate this
+ 		 descriptor.  */
+ 	      __mutex_unlock (&_hurd_dtable_lock);
+-	      /* We still hold FD1's lock, but this is safe because
+-		 _hurd_alloc_fd will only examine the cells starting
+-		 at FD2.  */
+ 	      d2 = _hurd_alloc_fd (NULL, fd2);
+ 	      if (d2)
+ 		__spin_unlock (&d2->port.lock);
+@@ -96,6 +95,7 @@ __dup2 (fd, fd2)
+ 							 MACH_PORT_NULL);
+ 		}
+ 	    }
++	  __mutex_unlock (&_hurd_dtable_lock);
+ 
+ 	  if (d2 == NULL)
+ 	    {
+@@ -119,7 +119,6 @@ __dup2 (fd, fd2)
+ 	      _hurd_port_locked_set (&d2->port, port); /* Unlocks D2.  */
+ 	    }
+ 	}
+-      __mutex_unlock (&_hurd_dtable_lock);
+ 
+       _hurd_port_free (&d->port, &ulink, port);
+       if (ctty != MACH_PORT_NULL)

Modified: glibc-package/branches/glibc-2.9/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-2.9/debian/patches/series	2009-01-27 21:20:22 UTC (rev 3255)
+++ glibc-package/branches/glibc-2.9/debian/patches/series	2009-01-27 21:23:18 UTC (rev 3256)
@@ -89,6 +89,7 @@
 hurd-i386/cvs-hurdsig-fix.diff
 hurd-i386/cvs-report-wait-fix.diff
 hurd-i386/submitted-critical-sections.diff
+hurd-i386/submitted-dup2-fix.diff
 
 i386/local-biarch.diff
 i386/local-clone.diff


Reply to: