From 1ad324ef42c6980205443c4afee594b8d0828590 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 15 Mar 2006 07:42:04 +0000 Subject: [PATCH] Replaced wait() with waitpid() SVN revision: 1674 --- src/elogd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 310e6a84..ad0d9b92 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -1059,15 +1059,15 @@ int subst_shell(char *cmd, char *result, int size) #endif /* OS_WINNT */ #ifdef OS_UNIX - pid_t pid; - int fh; + pid_t child_pid; + int fh, status; char str[256]; - if ((pid = fork()) < 0) + if ((child_pid = fork()) < 0) return 0; - else if (pid > 0) { + else if (child_pid > 0) { /* parent process waits for child */ - wait(NULL); + waitpid(child_pid, &status, WNOHANG); /* read back result */ fh = open("/tmp/elog-shell", O_RDONLY);