diff options
Diffstat (limited to 'net-wireless/aircrack-ng/files/process-group-leader.c')
-rw-r--r-- | net-wireless/aircrack-ng/files/process-group-leader.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net-wireless/aircrack-ng/files/process-group-leader.c b/net-wireless/aircrack-ng/files/process-group-leader.c new file mode 100644 index 0000000..4abdccc --- /dev/null +++ b/net-wireless/aircrack-ng/files/process-group-leader.c @@ -0,0 +1,26 @@ +#include <unistd.h> +#include <sys/signal.h> +#include <sys/wait.h> +#include <stdlib.h> + +int main (int argc, char *argv[]) { + pid_t pid; + + signal (SIGQUIT, SIG_IGN); + signal (SIGTERM, SIG_IGN); + setpgid (0, 0); + + pid=fork (); + if (pid == 0) { + int status; + wait (&status); + exit (WEXITSTATUS(status)); + } + else { + execv (argv[1], &argv[1]); + exit (1); + } + + return 0; +} + |