/* Waiting for a subprocess to finish.
- Copyright (C) 2001-2003 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2006 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
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/* Specification. */
#include "wait-process.h"
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
return 127. */
int
-wait_subprocess (pid_t child, const char *progname, int *exitsignal,
+wait_subprocess (pid_t child, const char *progname,
bool ignore_sigpipe, bool null_stderr,
bool slave_process, bool exit_on_error)
{
WAIT_T status;
*(int *) &status = 0;
- if (exitsignal) *exitsignal = 0;
for (;;)
{
int result = waitpid (child, &status, 0);
error (exit_on_error ? EXIT_FAILURE : 0, 0,
_("%s subprocess got fatal signal %d"),
progname, (int) WTERMSIG (status));
- if (exitsignal) *exitsignal = WTERMSIG (status);
return 127;
}
if (WEXITSTATUS (status) == 127)