Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch (fork()) {
- case -1 :
- perror("Validator: fork");
- break;
- case 0 :
- //child code
- if (close(pipe_dsc[1]) == -1)
- perror("Error in close(pipe_dsc[1])");
- printf("KURWA CO SIE ODJEVBALO");
- fflush(stdin);
- execl("./run", "run", pipe_read_dsc_str, NULL);
- perror("Error in execl\n");
- break;
- default :
- // parent code
- if (close(pipe_dsc[0]) == -1)
- perror("Validator: Error in close(pipe_dsc[0])\n");
- if (write(pipe_dsc[1], &am, sizeof(automaton)) != sizeof(automaton))
- perror("Validator: Error in write automaton\n");
- if (write(pipe_dsc[1], &am, sizeof(automaton)) != sizeof(automaton))
- perror("Validator: Error in write automaton\n");
- if (wait(0) == -1)
- perror("Validator: Error in wait\n");
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement