diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2014-10-08 01:29:12 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2014-10-08 01:29:12 +0200 |
commit | 1c3f90e3af0c3d6c8e946653169287baf5814ad4 (patch) | |
tree | 9b15e9ad8157bd8f9f697f6dc4e59146b6833c59 /Src/signals.c | |
parent | 1ffb184b46edd34d389af4e016abcaafec454d44 (diff) | |
parent | 9982ab6fb5266298c056326ed265fc8560202603 (diff) | |
download | zsh-1c3f90e3af0c3d6c8e946653169287baf5814ad4.tar.gz zsh-1c3f90e3af0c3d6c8e946653169287baf5814ad4.zip |
Merge commit '9982ab6fb5266298c056326ed265fc8560202603' into debian
This is exactly one commit after the zsh-5.0.7 and adds one missing
(and not unimportant) changelog entry for the 5.0.7 release.
Diffstat (limited to 'Src/signals.c')
-rw-r--r-- | Src/signals.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Src/signals.c b/Src/signals.c index cb2b58161..2df69f96e 100644 --- a/Src/signals.c +++ b/Src/signals.c @@ -594,6 +594,17 @@ zhandler(int sig) wait_for_processes(); break; + case SIGPIPE: + if (!handletrap(SIGPIPE)) { + if (!interact) + _exit(SIGPIPE); + else if (!isatty(SHTTY)) { + stopmsg = 1; + zexit(SIGPIPE, 1); + } + } + break; + case SIGHUP: if (!handletrap(SIGHUP)) { stopmsg = 1; @@ -752,7 +763,7 @@ dosavetrap(int sig, int level) Shfunc shf, newshf = NULL; if ((shf = (Shfunc)gettrapnode(sig, 1))) { /* Copy the node for saving */ - newshf = (Shfunc) zalloc(sizeof(*newshf)); + newshf = (Shfunc) zshcalloc(sizeof(*newshf)); newshf->node.nam = ztrdup(shf->node.nam); newshf->node.flags = shf->node.flags; newshf->funcdef = dupeprog(shf->funcdef, 0); @@ -897,6 +908,8 @@ removetrap(int sig) noholdintr(); } else if (sig == SIGHUP) install_handler(sig); + else if (sig == SIGPIPE && interact && !forklevel) + install_handler(sig); else if (sig && sig <= SIGCOUNT && #ifdef SIGWINCH sig != SIGWINCH && |