From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: that execution stuff
Date: Tue, 29 Jun 1999 08:56:01 +0200 (MET DST) [thread overview]
Message-ID: <199906290656.IAA18345@beta.informatik.hu-berlin.de> (raw)
Ok, I couldn't hold myself back...
This tries to get the always-pgrp-behavior back without losing the
other things that were fixed in the meanwhile. Now please test your
favorite execution bugs everyone and tell me what does not work.
I don't need to point out that `while true; do gzip ...; done' is not
expected to be ^C'able again, do I? Maybe we should document this?
(Together with the ^Z/fg/^C-trick?)
Bye
Sven
diff -u os/exec.c Src/exec.c
--- os/exec.c Mon Jun 28 16:18:30 1999
+++ Src/exec.c Mon Jun 28 22:03:09 1999
@@ -2210,9 +2210,8 @@
attachtty(jobtab[thisjob].gleader);
}
}
- else if (!(list_pipe || list_pipe_child || pline_level > 1) &&
- (!jobtab[thisjob].gleader ||
- setpgrp(0L, jobtab[thisjob].gleader) == -1)) {
+ else if (!jobtab[thisjob].gleader ||
+ setpgrp(0L, jobtab[thisjob].gleader) == -1) {
jobtab[thisjob].gleader = getpid();
if (list_pipe_job != thisjob &&
!jobtab[list_pipe_job].gleader)
diff -u os/init.c Src/init.c
--- os/init.c Mon Jun 28 16:18:31 1999
+++ Src/init.c Mon Jun 28 20:38:26 1999
@@ -390,16 +390,7 @@
#ifdef JOB_CONTROL
/* If interactive, make the shell the foreground process */
if (opts[MONITOR] && interact && (SHTTY != -1)) {
- /* Since we now sometimes execute programs in the process group
- * of the parent shell even when using job-control, we have to
- * make sure that we run in our own process group. Otherwise if
- * we are called from a program that doesn't put us in our own
- * group a SIGTSTP that we ignore might stop our parent process.
- * Instead of the two calls below we once had:
- * attachtty(GETPGRP());
- */
- attachtty(getpid());
- setpgrp(0L, 0L);
+ attachtty(GETPGRP());
if ((mypgrp = GETPGRP()) > 0) {
while ((ttpgrp = gettygrp()) != -1 && ttpgrp != mypgrp) {
sleep(1);
diff -u os/jobs.c Src/jobs.c
--- os/jobs.c Mon Jun 28 16:18:31 1999
+++ Src/jobs.c Mon Jun 28 21:52:44 1999
@@ -800,7 +800,7 @@
if (!p) {
jn->stat &= ~STAT_SUPERJOB;
if (WIFEXITED(jn->procs->status) &&
- !(jn->stat & STAT_CURSH))
+ killpg(jn->gleader, 0) == -1)
jn->gleader = mypgrp;
/* This deleted the job too early if the parent
shell waited for a command in a list that will
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-06-29 6:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-29 6:56 Sven Wischnowsky [this message]
1999-06-29 7:34 ` Bart Schaefer
1999-06-29 10:27 ` Andrej Borsenkow
1999-06-29 10:51 Sven Wischnowsky
1999-06-29 11:58 ` Andrej Borsenkow
1999-06-29 14:43 ` Bart Schaefer
1999-06-29 12:07 Sven Wischnowsky
1999-06-30 9:56 Sven Wischnowsky
1999-06-30 10:34 Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199906290656.IAA18345@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).