From: mdw Date: Fri, 18 Jun 1999 18:58:54 +0000 (+0000) Subject: Signal handling fixes. X-Git-Tag: 1.0.2~42 X-Git-Url: https://git.distorted.org.uk/~mdw/sw-tools/commitdiff_plain/f192155fd210c0e6caa77c86c319a09a1fc10714 Signal handling fixes. --- diff --git a/src/sw_rsh.c b/src/sw_rsh.c index fdacf12..4f2be0d 100644 --- a/src/sw_rsh.c +++ b/src/sw_rsh.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: sw_rsh.c,v 1.2 1999/06/02 17:03:29 mdw Exp $ + * $Id: sw_rsh.c,v 1.3 1999/06/18 18:58:54 mdw Exp $ * * Run remote commands * @@ -29,6 +29,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: sw_rsh.c,v $ + * Revision 1.3 1999/06/18 18:58:54 mdw + * Signal handling fixes. + * * Revision 1.2 1999/06/02 17:03:29 mdw * Fix use of `octet' now that mLib includes `bits.h' (as of version 1.3.5 * release). Also use the mLib load and store macros rather than doing it @@ -677,7 +680,10 @@ int swrsh(sw_remote *r, const char *host, const char *cmd, char *argv[]) if (!handler) { struct sigaction sa; sa.sa_handler = sigchld; - sa.sa_flags = 0; + sa.sa_flags = SA_NOCLDSTOP; +#ifdef SA_RESTART + sa.sa_flags |= SA_RESTART; +#endif sigemptyset(&sa.sa_mask); sigaction(SIGCHLD, &sa, 0); handler = 1; @@ -707,6 +713,8 @@ int swrsh(sw_remote *r, const char *host, const char *cmd, char *argv[]) if (!host) { r->fdin = r->fdout = sk[1]; + signal(SIGINT, SIG_DFL); + signal(SIGQUIT, SIG_DFL); remote(r, cmd, argv, environ); }