ast_comparator/test/student_data/anonymized/reference_17_tsh.c
/* 
 * sigint_handler - The kernel sends a SIGINT to the shell whenver the
 *    user types ctrl-c at the keyboard.  Catch it and send it along
 *    to the foreground job.  
 */
The kernel sends a SIGINT to the shell whenver the
user types ctrl-c at the keyboard.  Catch it and send it along
to the foreground job.
The kernel sends a SIGINT to the shell whenver the user types ctrl - c at the keyboard . Catch it and send it along to the foreground job .
void 
sigint_handler(int sig) 
{
    pid_t pid = fgpid(job_list);
    if (verbose) printf("sigint for %d\n", pid);
    if (pid <= 0) {
        if (verbose) printf("sigint_handler: no foreground job found");
        return;
    }
    kill(-pid, sig);
    return;
}
void sigint_handler ( int sig ) { pid_t pid = fgpid ( job_list ) ; if ( verbose ) printf ( " \n " , pid ) ; if ( pid <= 0 ) { if ( verbose ) printf ( " " ) ; return ; } kill ( - pid , sig ) ; return ; }
sigint_handler - The kernel sends a SIGINT to the shell whenver the
    user types ctrl-c at the keyboard.
sigint_handler - The kernel sends a SIGINT to the shell whenver the user types ctrl - c at the keyboard .
/* catch SIGINT and send to foreground job */ /* we have some foreground job */