aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/jobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/jobs.c')
-rw-r--r--bin/sh/jobs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index c0ba7d75e16d..1328ae50edef 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -30,14 +30,6 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
-#endif
-#endif /* not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/resource.h>
@@ -101,7 +93,7 @@ struct job {
short nprocs; /* number of processes */
pid_t pgrp; /* process group of this job */
char state; /* true if job is finished */
- char used; /* true if this entry is in used */
+ char used; /* true if this entry is in use */
char changed; /* true if status has changed */
char foreground; /* true if running in the foreground */
char remembered; /* true if $! referenced */
@@ -587,6 +579,8 @@ waitcmdloop(struct job *job)
return retval;
}
} else {
+ if (njobs == 0)
+ return 0;
for (jp = jobtab ; jp < jobtab + njobs; jp++)
if (jp->used && jp->state == JOBDONE) {
if (! iflag || ! jp->changed)