=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/job.c,v retrieving revision 1.50 retrieving revision 1.51 diff -c -r1.50 -r1.51 *** src/usr.bin/make/job.c 2002/03/19 00:08:31 1.50 --- src/usr.bin/make/job.c 2002/06/12 06:07:16 1.51 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: job.c,v 1.50 2002/03/19 00:08:31 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: job.c,v 1.51 2002/06/12 06:07:16 mpech Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* *************** *** 173,179 **** */ #define JOB_BUFSIZE 1024 typedef struct Job_ { ! int pid; /* The child's process ID */ GNode *node; /* The target the child is making */ LstNode tailCmds; /* The node of the first command to be * saved when the job has been run */ --- 173,179 ---- */ #define JOB_BUFSIZE 1024 typedef struct Job_ { ! pid_t pid; /* The child's process ID */ GNode *node; /* The target the child is making */ LstNode tailCmds; /* The node of the first command to be * saved when the job has been run */ *************** *** 469,476 **** int signo = *(int *)signop; if (DEBUG(JOB)) { (void)fprintf(stdout, ! "JobCondPassSig passing signal %d to child %d.\n", ! signo, job->pid); (void)fflush(stdout); } KILL(job->pid, signo); --- 469,476 ---- int signo = *(int *)signop; if (DEBUG(JOB)) { (void)fprintf(stdout, ! "JobCondPassSig passing signal %d to child %ld.\n", ! signo, (long)job->pid); (void)fflush(stdout); } KILL(job->pid, signo); *************** *** 569,575 **** void *job; /* job to examine */ void *pid; /* process id desired */ { ! return *(int *)pid - ((Job *)job)->pid; } /*- --- 569,575 ---- void *job; /* job to examine */ void *pid; /* process id desired */ { ! return *(pid_t *)pid - ((Job *)job)->pid; } /*- *************** *** 880,886 **** if (WIFEXITED(*status)) { if (DEBUG(JOB)) { ! (void)fprintf(stdout, "Process %d exited.\n", job->pid); (void)fflush(stdout); } if (WEXITSTATUS(*status) != 0) { --- 880,886 ---- if (WIFEXITED(*status)) { if (DEBUG(JOB)) { ! (void)fprintf(stdout, "Process %ld exited.\n", (long)job->pid); (void)fflush(stdout); } if (WEXITSTATUS(*status) != 0) { *************** *** 904,910 **** } } else if (WIFSTOPPED(*status)) { if (DEBUG(JOB)) { ! (void)fprintf(stdout, "Process %d stopped.\n", job->pid); (void)fflush(stdout); } if (usePipes && job->node != lastNode) { --- 904,910 ---- } } else if (WIFSTOPPED(*status)) { if (DEBUG(JOB)) { ! (void)fprintf(stdout, "Process %ld stopped.\n", (long)job->pid); (void)fflush(stdout); } if (usePipes && job->node != lastNode) { *************** *** 933,940 **** if (!(job->flags & JOB_CONTINUING)) { if (DEBUG(JOB)) { (void)fprintf(stdout, ! "Warning: process %d was not continuing.\n", ! job->pid); (void)fflush(stdout); } #ifdef notdef --- 933,940 ---- if (!(job->flags & JOB_CONTINUING)) { if (DEBUG(JOB)) { (void)fprintf(stdout, ! "Warning: process %ld was not continuing.\n", ! (long)job->pid); (void)fflush(stdout); } #ifdef notdef *************** *** 952,959 **** nJobs += 1; if (DEBUG(JOB)) { (void)fprintf(stdout, ! "Process %d is continuing locally.\n", ! job->pid); (void)fflush(stdout); } nLocal += 1; --- 952,959 ---- nJobs += 1; if (DEBUG(JOB)) { (void)fprintf(stdout, ! "Process %ld is continuing locally.\n", ! (long)job->pid); (void)fflush(stdout); } nLocal += 1; *************** *** 1193,1199 **** Job *job; /* Job to execute */ char **argv; { ! int cpid; /* ID of new child */ if (DEBUG(JOB)) { int i; --- 1193,1199 ---- Job *job; /* Job to execute */ char **argv; { ! pid_t cpid; /* ID of new child */ if (DEBUG(JOB)) { int i; *************** *** 2045,2051 **** Job_CatchChildren(block) bool block; /* true if should block on the wait. */ { ! int pid; /* pid of dead child */ Job *job; /* job descriptor for dead child */ LstNode jnode; /* list element for finding job */ int status; /* Exit/termination status */ --- 2045,2051 ---- Job_CatchChildren(block) bool block; /* true if should block on the wait. */ { ! pid_t pid; /* pid of dead child */ Job *job; /* job descriptor for dead child */ LstNode jnode; /* list element for finding job */ int status; /* Exit/termination status */ *************** *** 2061,2067 **** (block?0:WNOHANG)|WUNTRACED)) > 0) { if (DEBUG(JOB)) { ! (void)fprintf(stdout, "Process %d exited or stopped.\n", pid); (void)fflush(stdout); } --- 2061,2067 ---- (block?0:WNOHANG)|WUNTRACED)) > 0) { if (DEBUG(JOB)) { ! (void)fprintf(stdout, "Process %ld exited or stopped.\n", (long)pid); (void)fflush(stdout); } *************** *** 2072,2084 **** if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { jnode = Lst_Find(&stoppedJobs, JobCmpPid, &pid); if (jnode == NULL) { ! Error("Resumed child (%d) not in table", pid); continue; } job = (Job *)Lst_Datum(jnode); Lst_Remove(&stoppedJobs, jnode); } else { ! Error("Child (%d) not in table?", pid); continue; } } else { --- 2072,2084 ---- if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { jnode = Lst_Find(&stoppedJobs, JobCmpPid, &pid); if (jnode == NULL) { ! Error("Resumed child (%ld) not in table", (long)pid); continue; } job = (Job *)Lst_Datum(jnode); Lst_Remove(&stoppedJobs, jnode); } else { ! Error("Child (%ld) not in table?", (long)pid); continue; } } else { *************** *** 2570,2577 **** if (job->pid) { if (DEBUG(JOB)) { (void)fprintf(stdout, ! "JobInterrupt passing signal to child %d.\n", ! job->pid); (void)fflush(stdout); } KILL(job->pid, signo); --- 2570,2577 ---- if (job->pid) { if (DEBUG(JOB)) { (void)fprintf(stdout, ! "JobInterrupt passing signal to child %ld.\n", ! (long)job->pid); (void)fflush(stdout); } KILL(job->pid, signo); *************** *** 2702,2708 **** /* * Catch as many children as want to report in at first, then give up */ ! while (waitpid((pid_t) -1, &foo, WNOHANG) > 0) continue; (void)eunlink(tfile); } --- 2702,2708 ---- /* * Catch as many children as want to report in at first, then give up */ ! while (waitpid(-1, &foo, WNOHANG) > 0) continue; (void)eunlink(tfile); }