diff options
author | cracauer <cracauer@FreeBSD.org> | 1998-08-24 10:20:37 +0000 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 1998-08-24 10:20:37 +0000 |
commit | 8a3c521f04ee9ad807d4c737f050230cb04ce36d (patch) | |
tree | 8ccf28d7f10330488ab5bce78116d30f74886c79 /bin/sh/jobs.h | |
parent | f3d290b0b53aa55bf027aba6c54dd0e5b1d101f3 (diff) | |
download | FreeBSD-src-8a3c521f04ee9ad807d4c737f050230cb04ce36d.zip FreeBSD-src-8a3c521f04ee9ad807d4c737f050230cb04ce36d.tar.gz |
Do not exit on SIGINT in non-interactive shells, fixes PR 1206,
i.e. this makes emacs usable from system(3). Programs called from
shellscripts are now required to exit with proper signal status. That
means, they have to kill themself. Exiting with faked numerical exit
code is not sufficient.
Exit with proper signal status if script exits on signal.
Make the wait builtin interruptable, both with and without traps set.
Use volatile sig_atomic_t where (and only where) appropriate.
(Almost) fix printing of newlines on SIGINT.
Make traps setable from trap handlers. This is needed for shellscripts
that catch SIGINT for cleanup work but intend to exit on it, hance
have to kill themself from a trap handler. I.e. mkdep.
While I'm at it, make it -Wall clean. -Wall is not enabled in
Makefile, since vararg warnx() macro calls in usr.bin/printf/printf.c
are not -Wall-able.
PR: 1206
Obtained from: Basic SIGINT fix from Bruce Evans
Diffstat (limited to 'bin/sh/jobs.h')
-rw-r--r-- | bin/sh/jobs.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/sh/jobs.h b/bin/sh/jobs.h index 6e5859d..3182a65 100644 --- a/bin/sh/jobs.h +++ b/bin/sh/jobs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)jobs.h 8.2 (Berkeley) 5/4/95 - * $Id: jobs.h,v 1.5 1997/02/22 13:58:29 peter Exp $ + * $Id: jobs.h,v 1.6 1997/08/18 02:53:20 steve Exp $ */ /* Mode argument to forkshell. Don't change FORK_FG or FORK_BG. */ @@ -42,6 +42,7 @@ #define FORK_BG 1 #define FORK_NOJOB 2 +#include <signal.h> /* For sig_atomic_t */ /* * A job structure contains information about a job. A job is either a @@ -77,6 +78,8 @@ struct job { extern pid_t backgndpid; /* pid of last background process */ extern int job_warning; /* user was warned about stopped jobs */ +extern int in_waitcmd; /* Are we in wait? */ +extern volatile sig_atomic_t breakwaitcmd; /* Should wait be terminated? */ void setjobctl __P((int)); int fgcmd __P((int, char **)); |