|
|
|
@ -1,6 +1,5 @@ |
|
|
|
|
#include <sys/wait.h> |
|
|
|
|
#include <stdlib.h> |
|
|
|
|
#include <stdio.h> |
|
|
|
|
#include <unistd.h> |
|
|
|
|
#include <errno.h> |
|
|
|
|
|
|
|
|
@ -32,15 +31,13 @@ int |
|
|
|
|
main (int argc __UNUSED__, char **argv __UNUSED__) |
|
|
|
|
{ |
|
|
|
|
int status = 0; |
|
|
|
|
char *pid, *exit_policy; |
|
|
|
|
char *pid; |
|
|
|
|
struct sigaction action; |
|
|
|
|
|
|
|
|
|
pid_t rpid; |
|
|
|
|
pid = getenv("ENTRANCE_XPID"); |
|
|
|
|
if (!pid) return -1; |
|
|
|
|
_x_pid = atoi(pid); |
|
|
|
|
|
|
|
|
|
exit_policy = getenv("ENTRANCE_FAST_QUIT"); |
|
|
|
|
|
|
|
|
|
action.sa_sigaction = _entrance_wait_action; |
|
|
|
|
action.sa_flags = SA_RESTART | SA_SIGINFO; |
|
|
|
@ -64,17 +61,8 @@ main (int argc __UNUSED__, char **argv __UNUSED__) |
|
|
|
|
} |
|
|
|
|
if (_x_pid == rpid) |
|
|
|
|
{ |
|
|
|
|
if (exit_policy) |
|
|
|
|
{ |
|
|
|
|
setenv("ENTRANCE_QUIT", "1", 1); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if ( WIFEXITED(status) && WEXITSTATUS(status)) |
|
|
|
|
{ |
|
|
|
|
setenv("ENTRANCE_QUIT", "1", 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (WIFEXITED(status) && WEXITSTATUS(status)) |
|
|
|
|
setenv("ENTRANCE_QUIT", "1", 1); |
|
|
|
|
execlp(PACKAGE_SBIN_DIR"/entrance", PACKAGE_SBIN_DIR"/entrance", "--nodaemon", NULL); |
|
|
|
|
} |
|
|
|
|
return -1; |
|
|
|
|