Guest User

Untitled

a guest
Dec 3rd, 2019
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int x;
  2. int fc=waitpid(i,&x,0);
  3. printf("%d\t",getpid());
  4. printf("%d\t",fc);
  5. printf("%s\t",fhalf);
  6. printf("%c\t\n",WEXITSTATUS(x));
  7.  
  8. int y;
  9. int sc=waitpid(j,&y,0);
  10. printf("%d\t",getpid());
  11. printf("%d\t",sc);
  12. printf("%s\t",shalf);
  13. printf("%c\t\n",WEXITSTATUS(y));
  14.  
  15. free(fhalf);
  16. free(shalf);
  17. if(WEXITSTATUS(y)>WEXITSTATUS(x))
  18. {
  19. return WEXITSTATUS(y);
  20. }
  21. else return WEXITSTATUS(x);
  22.  
  23. }
  24. else
  25. {
  26.  
  27. char *temp[]={argv[0],shalf,NULL};
  28. execv(argv[0],temp);
  29. }
  30. }
  31.  
  32. else {
  33.  
  34. char *temp[]={argv[0],fhalf,NULL};
  35. execv(argv[0],temp);
  36.  
  37. }
  38.  
  39.  
  40. }
  41.  
  42. else
  43. {
  44. return argv[1][0];
  45. }
  46.  
  47. }
  48.  
  49. return 0;
  50. }
RAW Paste Data