changeset 10194:8297e6235e2d

Add an assertion.
author Bruno Haible <bruno@clisp.org>
date Tue, 10 Jun 2008 13:57:21 +0200
parents b67d0f4f1513
children cc40656bc64e
files ChangeLog lib/wait-process.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jun 10 13:55:34 2008 +0200
+++ b/ChangeLog	Tue Jun 10 13:57:21 2008 +0200
@@ -1,3 +1,7 @@
+2008-06-10  Bruno Haible  <bruno@clisp.org>
+
+	* lib/wait-process.c (wait_subprocess): Add an assertion.
+
 2008-06-10  Bruno Haible  <bruno@clisp.org>
 
 	* lib/wait-process.c (wait_subprocess): Try to fix waitid() based code.
--- a/lib/wait-process.c	Tue Jun 10 13:55:34 2008 +0200
+++ b/lib/wait-process.c	Tue Jun 10 13:57:21 2008 +0200
@@ -1,5 +1,5 @@
 /* Waiting for a subprocess to finish.
-   Copyright (C) 2001-2003, 2005-2007 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2008 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -369,7 +369,8 @@
 	}
 
       /* One of WIFSIGNALED (status), WIFEXITED (status), WIFSTOPPED (status)
-	 must always be true.  Loop until the program terminates.  */
+	 must always be true, since we did not specify WCONTINUED in the
+	 waitpid() call.  Loop until the program terminates.  */
       if (!WIFSTOPPED (status))
 	break;
     }
@@ -394,6 +395,8 @@
 	       progname, (int) WTERMSIG (status));
       return 127;
     }
+  if (!WIFEXITED (status))
+    abort ();
   if (WEXITSTATUS (status) == 127)
     {
       if (exit_on_error || !null_stderr)