From 4778be66667b1877f3d696f4369b24509972ae85 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 10 Jun 2008 13:57:21 +0200 Subject: [PATCH] Add an assertion. --- ChangeLog | 4 ++++ lib/wait-process.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 585e59ee6b..5269090b03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-06-10 Bruno Haible + + * lib/wait-process.c (wait_subprocess): Add an assertion. + 2008-06-10 Bruno Haible * lib/wait-process.c (wait_subprocess): Try to fix waitid() based code. diff --git a/lib/wait-process.c b/lib/wait-process.c index e3086b4285..e98c644efb 100644 --- a/lib/wait-process.c +++ b/lib/wait-process.c @@ -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 , 2001. This program is free software: you can redistribute it and/or modify @@ -369,7 +369,8 @@ wait_subprocess (pid_t child, const char *progname, } /* 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 @@ wait_subprocess (pid_t child, const char *progname, progname, (int) WTERMSIG (status)); return 127; } + if (!WIFEXITED (status)) + abort (); if (WEXITSTATUS (status) == 127) { if (exit_on_error || !null_stderr) -- 2.30.2