diff options
author | Bruno Haible <bruno@clisp.org> | 2008-06-10 17:38:39 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2008-06-10 17:39:26 +0200 |
commit | f7bab1b29955f86484cb70871c7b88915542abeb (patch) | |
tree | 2e6d7717b432f509dbe03f2bf687e8226e88fac1 /lib/execute.c | |
parent | 5ca9556a818e721db2e43ed16155e3f0fedf2093 (diff) | |
download | gnulib-f7bab1b29955f86484cb70871c7b88915542abeb.tar.gz |
Add termsigp argument to execute() and wait_process().
Diffstat (limited to 'lib/execute.c')
-rw-r--r-- | lib/execute.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/execute.c b/lib/execute.c index cfac1962df..751dcb384b 100644 --- a/lib/execute.c +++ b/lib/execute.c @@ -117,7 +117,8 @@ execute (const char *progname, const char *prog_path, char **prog_argv, bool ignore_sigpipe, bool null_stdin, bool null_stdout, bool null_stderr, - bool slave_process, bool exit_on_error) + bool slave_process, bool exit_on_error, + int *termsigp) { #if defined _MSC_VER || defined __MINGW32__ @@ -173,6 +174,9 @@ execute (const char *progname, if (null_stdin) dup2 (orig_stdin, STDIN_FILENO), close (orig_stdin); + if (termsigp != NULL) + *termsigp = 0; + if (exitcode == -1) { if (exit_on_error || !null_stderr) @@ -251,6 +255,8 @@ execute (const char *progname, posix_spawnattr_destroy (&attrs); if (slave_process) unblock_fatal_signals (); + if (termsigp != NULL) + *termsigp = 0; if (exit_on_error || !null_stderr) error (exit_on_error ? EXIT_FAILURE : 0, err, _("%s subprocess failed"), progname); @@ -293,6 +299,8 @@ execute (const char *progname, { if (slave_process) unblock_fatal_signals (); + if (termsigp != NULL) + *termsigp = 0; if (exit_on_error || !null_stderr) error (exit_on_error ? EXIT_FAILURE : 0, errno, _("%s subprocess failed"), progname); @@ -306,7 +314,7 @@ execute (const char *progname, } return wait_subprocess (child, progname, ignore_sigpipe, null_stderr, - slave_process, exit_on_error); + slave_process, exit_on_error, termsigp); #endif } |