add old ebuilds from svn ub0rlay
[ub0rlay.git] / net-wireless / aircrack-ng / files / process-group-leader.c
1 #include <unistd.h>
2 #include <sys/signal.h>
3 #include <sys/wait.h>
4 #include <stdlib.h>
5
6 int main (int argc, char *argv[]) {
7 pid_t pid;
8
9 signal (SIGQUIT, SIG_IGN);
10 signal (SIGTERM, SIG_IGN);
11 setpgid (0, 0);
12
13 pid=fork ();
14 if (pid == 0) {
15 int status;
16 wait (&status);
17 exit (WEXITSTATUS(status));
18 }
19 else {
20 execv (argv[1], &argv[1]);
21 exit (1);
22 }
23
24 return 0;
25 }
26