ast_comparator/test/student_data/handout/shlab-handout/cases/reference_11_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 *job_list, pid_t pid) 
{
    int i;
    if (pid < 1)
        return 0;
    for (i = 0; i < MAXJOBS; i++) {
        if (job_list[i].pid == pid) {
            clearjob(&job_list[i]);
            nextjid = maxjid(job_list)+1;
            return 1;
        }
    }
    return 0;
}
int deletejob ( struct job_t * job_list , pid_t pid ) { int i ; if ( pid < 1 ) return 0 ; for ( i = 0 ; i < MAXJOBS ; i ++ ) { if ( job_list [ i ] . pid == pid ) { clearjob ( & job_list [ i ] ) ; nextjid = maxjid ( job_list ) + 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