ast_comparator/test/student_data/handout/shlab-handout/cases/prev_8_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[i].pid == pid) {
      clearjob(&jobs[i]);
      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 [ i ] . pid == pid ) { clearjob ( & jobs [ i ] ) ; 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