about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-02-20 09:16:46 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-02-20 09:16:46 +0000
commitfbe44ac8381e84e02a197803b186c12dfbcfecbc (patch)
tree1df314e51be46f4b4373b57f07016e1b2619345b
parentcd02c345afdedd31b767530dfb826b56c61ac6d7 (diff)
downloadzsh-fbe44ac8381e84e02a197803b186c12dfbcfecbc.tar.gz
zsh-fbe44ac8381e84e02a197803b186c12dfbcfecbc.tar.xz
zsh-fbe44ac8381e84e02a197803b186c12dfbcfecbc.zip
more (|un)queue_signals(), this time for the job control builtins (13509)
-rw-r--r--ChangeLog5
-rw-r--r--Src/jobs.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 530e0310d..80bc1f79f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-20  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 13509: Src/jobs.c: more (|un)queue_signals(), this time for the
+ 	job control builtins
+	
 2001-02-19  Peter Stephenson  <pws@csr.com>
 
 	* Alexandre: 13280: Doc/Zsh/expn.yo, Src/hist.c, Src/string.c,
diff --git a/Src/jobs.c b/Src/jobs.c
index c491094b3..bfc95ab61 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1248,6 +1248,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
 	return 1;
     }
 
+    queue_signals();
     /* If necessary, update job table. */
     if (unset(NOTIFY))
 	scanjobs();
@@ -1267,6 +1268,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
 	    point or else. */
 	    if (curjob == -1 || (jobtab[curjob].stat & STAT_NOPRINT)) {
 		zwarnnam(name, "no current job", NULL, 0);
+		unqueue_signals();
 		return 1;
 	    }
 	    firstjob = curjob;
@@ -1280,11 +1282,13 @@ bin_fg(char *name, char **argv, char *ops, int func)
 			(ops['s'] && jobtab[job].stat & STAT_STOPPED))
 			printjob(job + jobtab, lng, 2);
 		}
+	    unqueue_signals();
 	    return 0;
 	} else {   /* Must be BIN_WAIT, so wait for all jobs */
 	    for (job = 0; job != MAXJOB; job++)
 		if (job != thisjob && jobtab[job].stat)
 		    zwaitjob(job, SIGINT);
+	    unqueue_signals();
 	    return 0;
 	}
     }
@@ -1319,6 +1323,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
 	if (!(jobtab[job].stat & STAT_INUSE) ||
 	    (jobtab[job].stat & STAT_NOPRINT)) {
 	    zwarnnam(name, "no such job: %d", 0, job);
+	    unqueue_signals();
 	    return 1;
 	}
 	/* We have a job number.  Now decide what to do with it. */
@@ -1334,6 +1339,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
 		/* Silly to bg a job already running. */
 		zwarnnam(name, "job already in background", NULL, 0);
 		thisjob = ocj;
+		unqueue_signals();
 		return 1;
 	    }
 	    /* It's time to shuffle the jobs around!  Reset the current job,
@@ -1391,6 +1397,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
 	}
 	thisjob = ocj;
     }
+    unqueue_signals();
     return retval;
 }
 
@@ -1473,6 +1480,7 @@ bin_kill(char *nam, char **argv, char *ops, int func)
 	argv++;
     }
 
+    queue_signals();
     setcurjob();
 
     /* Remaining arguments specify processes.  Loop over them, and send the
@@ -1509,6 +1517,8 @@ bin_kill(char *nam, char **argv, char *ops, int func)
 	    returnval++;
 	}
     }
+    unqueue_signals();
+
     return returnval < 126 ? returnval : 1;
 }