Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. while(1) {
  2.     bool czyczekac = true;
  3.  
  4.     ...
  5.  
  6.     if(read_line[length-2]=='&') {
  7.         czyczekac = false;
  8.         read_line[length-2]='\0'
  9. ;   }
  10.  
  11.     ...
  12.  
  13.     int pid = fork();
  14.     if(pid == 0) {
  15.         execvp(progpath, argv);
  16.         fprint(stderr, "Couldn execvp\n");
  17.         exit(EXIT_FAILURE);
  18.     } else {
  19.         if(czyczekac) {
  20.             wait();
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement