1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/sh/jobs.c 138312 2004-12-02 13:12:43Z maxim $"); |
40 41#include <fcntl.h> 42#include <signal.h> 43#include <errno.h> 44#include <paths.h> 45#include <unistd.h> 46#include <stdlib.h> 47#include <sys/param.h> --- 873 unchanged lines hidden (view full) --- 921 do { 922 pid = waitproc(block, &status); 923 TRACE(("wait returns %d, status=%d\n", (int)pid, status)); 924 } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) || 925 (pid > 0 && WIFSTOPPED(status) && !iflag)); 926 in_dowait--; 927 if (breakwaitcmd != 0) { 928 breakwaitcmd = 0; |
929 if (pid <= 0) 930 return -1; |
931 } 932 if (pid <= 0) 933 return pid; 934 INTOFF; 935 thisjob = NULL; 936 for (jp = jobtab ; jp < jobtab + njobs ; jp++) { 937 if (jp->used) { 938 done = 1; --- 303 unchanged lines hidden --- |