Guest User

Untitled

a guest
Jun 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. int is_jid = ('%' == *argv[1]);
  2. int job_num = atoi(argv[1] + is_jid);
  3. struct job_t * job = (is_jid ? getjobjid(jobs, job_num) : getjobpid(jobs, job_num));
  4.  
  5. /*if argv[0] is "bg"*/
  6. if(!strcmp(argv[0], "bg")) {
  7. if (job->state == ST)
  8. if (kill(job->pid, SIGCONT))
  9. unix_error("kill error: SIGCONT");
  10. }
  11.  
  12. /*if argv[0] is fg*/
  13. else
  14. waitfg(fgpid(jobs));
  15.  
  16. return;
Add Comment
Please, Sign In to add comment