ast_comparator/test/student_data/handout/shlab-handout/cases/reference_32_tsh.c
/* deletejob - Delete a job whose PID=pid from the job list */
Delete a job whose PID=pid from the job list
Delete a job whose PID = pid from the job list
int deletejob(struct job_t *jobs, pid_t pid) {
int i;
if (pid < 1)
return 0;
for (i = 0; i < MAXJOBS; i++) {
if (jobs->pid == pid) {
clearjob(&jobs);
nextjid = maxjid(jobs) + 1;
return 1;
}
}
return 0;
}
int deletejob ( struct job_t * jobs , pid_t pid ) { int i ; if ( pid < 1 ) return 0 ; for ( i = 0 ; i < MAXJOBS ; i ++ ) { if ( jobs -> pid == pid ) { clearjob ( & jobs ) ; nextjid = maxjid ( jobs ) + 1 ; return 1 ; } } return 0 ; }
deletejob - Delete a job whose PID=pid from the job list
deletejob - Delete a job whose PID = pid from the job list