From 4aba574b3af1119da5ff80f436d9c7d32d2d4b65 Mon Sep 17 00:00:00 2001 From: jweiss Date: Tue, 17 Oct 1995 22:58:27 +0000 Subject: [PATCH] WIFEXITED(waitb) is true if the script exits even with exit 0. changed so we only return an error if something other than an exit 0 occurs. Note that the error returned in the case of death doe to a signal will be a bogus error. --- update/exec_002.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/update/exec_002.c b/update/exec_002.c index 03188efc..34c0cce4 100644 --- a/update/exec_002.c +++ b/update/exec_002.c @@ -110,7 +110,13 @@ exec_002(str) sigsetmask(mask); #endif #ifdef POSIX - if (WIFEXITED(waitb)) { + if ( (WIFEXITED(waitb) && (WEXITSTATUS(waitb)!=0)) || WIFSIGNALED(waitb) ) { + /* This is not really correct. It will cause teh moira server to + report a bogus error message if the script died on a signal. + However this is the same thing that occurs in the non-POSIX + case, and I don't know how to come up with a useful error based + on the signal recieved. + */ n = WEXITSTATUS(waitb) + ERROR_TABLE_BASE_sms; log_priority = log_ERROR; com_err(whoami, n, " child exited with status %d", -- 2.45.1