This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch, master, updated. glibc-2.15-653-g87ef29c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  87ef29ca94bb5b4bb6a0b8ef40d387470d4baac3 (commit)
      from  f23f459dd38eaf61cb574c7312599975e13468a9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=87ef29ca94bb5b4bb6a0b8ef40d387470d4baac3

commit 87ef29ca94bb5b4bb6a0b8ef40d387470d4baac3
Author: Roland McGrath <roland@hack.frob.com>
Date:   Tue Apr 24 13:12:12 2012 -0700

    Hurd: fix symlink/symlinkat error case not to do an extraneous __mach_port_deallocate.

diff --git a/ChangeLog b/ChangeLog
index fc74310..1c13c37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-04-24  Roland McGrath  <roland@hack.frob.com>
+
+	* sysdeps/mach/hurd/symlink.c: Don't call __mach_port_deallocate on
+	NODE when __dir_mkfile failed.
+	* sysdeps/mach/hurd/symlinkat.c: Likewise.
+	Reported by Ludovic Courtès <ludo@gnu.org>.
+
 2012-04-24  Andreas Jaeger  <aj@suse.de>
 
 	* Makerules (common-clean): Also remove gen-as-const-headers
diff --git a/sysdeps/mach/hurd/symlink.c b/sysdeps/mach/hurd/symlink.c
index 8bca405..0754b18 100644
--- a/sysdeps/mach/hurd/symlink.c
+++ b/sysdeps/mach/hurd/symlink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,19 +46,22 @@ __symlink (from, to)
   err = __dir_mkfile (dir, O_WRITE, 0777 & ~_hurd_umask, &node);
 
   if (! err)
-    /* Set the node's translator to make it a symlink.  */
-    err = __file_set_translator (node,
-				 FS_TRANS_EXCL|FS_TRANS_SET,
-				 FS_TRANS_EXCL|FS_TRANS_SET, 0,
-				 buf, sizeof (_HURD_SYMLINK) + len,
-				 MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND);
+    {
+      /* Set the node's translator to make it a symlink.  */
+      err = __file_set_translator (node,
+                                   FS_TRANS_EXCL|FS_TRANS_SET,
+                                   FS_TRANS_EXCL|FS_TRANS_SET, 0,
+                                   buf, sizeof (_HURD_SYMLINK) + len,
+                                   MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND);
 
-  if (! err)
-    /* Link the node, now a valid symlink, into the target directory.  */
-    err = __dir_link (dir, node, name, 1);
+      if (! err)
+        /* Link the node, now a valid symlink, into the target directory.  */
+        err = __dir_link (dir, node, name, 1);
+
+      __mach_port_deallocate (__mach_task_self (), node);
+    }
 
   __mach_port_deallocate (__mach_task_self (), dir);
-  __mach_port_deallocate (__mach_task_self (), node);
 
   if (err)
     return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/symlinkat.c b/sysdeps/mach/hurd/symlinkat.c
index 0fa667d..ff11ecd 100644
--- a/sysdeps/mach/hurd/symlinkat.c
+++ b/sysdeps/mach/hurd/symlinkat.c
@@ -1,6 +1,5 @@
 /* Create a symbolic link named relative to an open directory.  Hurd version.
-   Copyright (C) 1991,1992,1993,1994,1995,1996,1997,2006
-	Free Software Foundation, Inc.
+   Copyright (C) 1991-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -53,19 +52,22 @@ symlinkat (from, fd, to)
   err = __dir_mkfile (dir, O_WRITE, 0777 & ~_hurd_umask, &node);
 
   if (! err)
-    /* Set the node's translator to make it a symlink.  */
-    err = __file_set_translator (node,
-				 FS_TRANS_EXCL|FS_TRANS_SET,
-				 FS_TRANS_EXCL|FS_TRANS_SET, 0,
-				 buf, sizeof (_HURD_SYMLINK) + len,
-				 MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND);
+    {
+      /* Set the node's translator to make it a symlink.  */
+      err = __file_set_translator (node,
+                                   FS_TRANS_EXCL|FS_TRANS_SET,
+                                   FS_TRANS_EXCL|FS_TRANS_SET, 0,
+                                   buf, sizeof (_HURD_SYMLINK) + len,
+                                   MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND);
 
-  if (! err)
-    /* Link the node, now a valid symlink, into the target directory.  */
-    err = __dir_link (dir, node, name, 1);
+      if (! err)
+        /* Link the node, now a valid symlink, into the target directory.  */
+        err = __dir_link (dir, node, name, 1);
+
+      __mach_port_deallocate (__mach_task_self (), node);
+    }
 
   __mach_port_deallocate (__mach_task_self (), dir);
-  __mach_port_deallocate (__mach_task_self (), node);
 
   if (err)
     return __hurd_fail (err);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |    7 +++++++
 sysdeps/mach/hurd/symlink.c   |   25 ++++++++++++++-----------
 sysdeps/mach/hurd/symlinkat.c |   26 ++++++++++++++------------
 3 files changed, 35 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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