ast_comparator/test/student_data/handout/shlab-handout/cases/36_tsh.c
/* handle_sig - print message and modify/delete job_t in jobs list */
print message and modify/delete job_t in jobs list
print message and modify / delete job_t in jobs list
void handle_sig(struct job_t *target, int sig){
  char *message = "terminated";
  if(sig != SIGINT)
    message = "stopped";
  if(target != NULL){
    printf("Job [%d] (%d) %s by signal %d\n", target->jid, target->pid, message, sig);
    if(sig == SIGINT)
      deletejob(jobs, target->pid);
    else
      target->state = ST;
  }
  return;
}
void handle_sig ( struct job_t * target , int sig ) { char * message = " " ; if ( sig != SIGINT ) message = " " ; if ( target != NULL ) { printf ( " \n " , target -> jid , target -> pid , message , sig ) ; if ( sig == SIGINT ) deletejob ( jobs , target -> pid ) ; else target -> state = ST ; } return ; }
handle_sig - print message and modify/delete job_t in jobs list
handle_sig - print message and modify / delete job_t in jobs list