Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
printf("Courant:\n");
show_proc_pids();
- pid_t rtf = fork();
+ pid_t cpid = fork();
- if (rtf == -1) {
+ if (cpid == -1) {
printf("Erreur de clonage\n");
exit(EXIT_FAILURE);
- } else if (rtf == 0) {
+ } else if (cpid == 0) {
printf("Fils:\n");
show_proc_pids();
exit(EXIT_FAILURE);
} else {
printf("Parent:\n");
show_proc_pids();
- pid_t rtw = wait(&status);
+ pid_t wpid = wait(&status);
+ printf("Fin du PID: %d\n", wpid);
system("ps aux");
if (WIFEXITED(status)) {
printf("Fils termine, status=%d\n", WEXITSTATUS(status));