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.19-709-g6f12d06


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  6f12d0629f411c6b580585dbcfb4409a72b7362e (commit)
      from  cb403c34c6f6e1cce5018864485958cfc2e28906 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6f12d0629f411c6b580585dbcfb4409a72b7362e

commit 6f12d0629f411c6b580585dbcfb4409a72b7362e
Author: Arjun Shankar <arjun.is@lostca.se>
Date:   Fri Jun 27 23:31:47 2014 +0530

    Correctly report nscd child process status (BZ #17092)
    
    The nscd parent process returns the result of a `wait' call rather
    than the exit status of the child it waits for. These two aren't
    exactly the same. In my case (and probably on most machines), the exit
    status is in the 2nd LSB of the result of `wait', and so:
    
    e.g. if the nscd child process returns 1, the parent returns 1 << 8,
    which Bash happily reports as 0.

diff --git a/ChangeLog b/ChangeLog
index 510e78a..79ac387 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-27  Arjun Shankar  <arjun.is@lostca.se>
+
+	[BZ #17092]
+	* nscd/nscd.c (monitor_child): Return exit status of child
+	instead of return value from wait syscall.
+
 2014-06-27  Joseph Myers  <joseph@codesourcery.com>
 
 	* configure.ac (libc_commonpagesize): Remove variable.
diff --git a/NEWS b/NEWS
index 7663f01..02e3cd8 100644
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ Version 2.20
   16882, 16885, 16888, 16890, 16912, 16915, 16916, 16917, 16918, 16922,
   16927, 16928, 16932, 16943, 16958, 16965, 16966, 16967, 16977, 16978,
   16984, 16990, 16996, 17009, 17022, 17031, 17042, 17048, 17050, 17058,
-  17061, 17062, 17069, 17075, 17079, 17084, 17086.
+  17061, 17062, 17069, 17075, 17079, 17084, 17086, 17092.
 
 * Optimized strchr implementation for AArch64.  Contributed by ARM Ltd.
 
diff --git a/nscd/nscd.c b/nscd/nscd.c
index 3dd1135..7131ead 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -612,21 +612,25 @@ monitor_child (int fd)
      method, like a segfault.  */
   if (ret <= 0 || child_ret != 0)
     {
-      int err = wait (&child_ret);
+      int status;
+      int err = wait (&status);
 
       if (err < 0)
 	{
-	  fprintf (stderr, _("wait failed"));
+	  fprintf (stderr, _("'wait' failed\n"));
 	  return 1;
 	}
 
-      fprintf (stderr, _("child exited with status %d"),
-	       WEXITSTATUS (child_ret));
-      if (WIFSIGNALED (child_ret))
-	fprintf (stderr, _(", terminated by signal %d.\n"),
-		 WTERMSIG (child_ret));
-      else
-	fprintf (stderr, ".\n");
+      if (WIFEXITED (status))
+        {
+          child_ret = WEXITSTATUS (status);
+          fprintf (stderr, _("child exited with status %d\n"), child_ret);
+        }
+      if (WIFSIGNALED (status))
+        {
+          child_ret = WTERMSIG (status);
+          fprintf (stderr, _("child terminated by signal %d\n"), child_ret);
+        }
     }
 
   /* We have the child status, so exit with that code.  */

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

Summary of changes:
 ChangeLog   |    6 ++++++
 NEWS        |    2 +-
 nscd/nscd.c |   22 +++++++++++++---------
 3 files changed, 20 insertions(+), 10 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]