Revert my last commit & make entrance quit in any way
This commit is contained in:
parent
1be65edee7
commit
d7d7f89d23
|
@ -317,23 +317,27 @@ main (int argc, char ** argv)
|
||||||
entrance_user = getenv("ENTRANCE_USER");
|
entrance_user = getenv("ENTRANCE_USER");
|
||||||
if (entrance_user)
|
if (entrance_user)
|
||||||
{
|
{
|
||||||
char *quit;
|
char *quit, *x_pid_char;
|
||||||
entrance_session_init(dname);
|
entrance_session_init(dname);
|
||||||
entrance_session_end(entrance_user);
|
entrance_session_end(entrance_user);
|
||||||
entrance_session_shutdown();
|
entrance_session_shutdown();
|
||||||
sleep(2);
|
|
||||||
entrance_xserver_end();
|
|
||||||
quit = getenv("ENTRANCE_QUIT");
|
quit = getenv("ENTRANCE_QUIT");
|
||||||
if (quit)
|
if (quit)
|
||||||
{
|
{
|
||||||
unsetenv("ENTRANCE_QUIT");
|
unsetenv("ENTRANCE_QUIT");
|
||||||
_remove_lock();
|
PT("Last DE Session quit with error!\n");
|
||||||
entrance_config_shutdown();
|
|
||||||
PT("Bye, see you.\n\n");
|
|
||||||
entrance_close_log();
|
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
PT("Nice to see you again. Entrance will restart.\n");
|
PT("ending xserver\n");
|
||||||
|
x_pid_char = getenv("ENTRANCE_XPID");
|
||||||
|
if (x_pid_char)
|
||||||
|
kill(atoi(x_pid_char), SIGTERM);
|
||||||
|
else
|
||||||
|
PT("No Xserver found, Strange!\n");
|
||||||
|
entrance_xserver_end();
|
||||||
|
_remove_lock();
|
||||||
|
PT("Entrance will quit, bye bye :).\n");
|
||||||
|
entrance_close_log();
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
PT("Welcome\n");
|
PT("Welcome\n");
|
||||||
ecore_init();
|
ecore_init();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
@ -32,15 +31,13 @@ int
|
||||||
main (int argc __UNUSED__, char **argv __UNUSED__)
|
main (int argc __UNUSED__, char **argv __UNUSED__)
|
||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
char *pid, *exit_policy;
|
char *pid;
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
|
|
||||||
pid_t rpid;
|
pid_t rpid;
|
||||||
pid = getenv("ENTRANCE_XPID");
|
pid = getenv("ENTRANCE_XPID");
|
||||||
if (!pid) return -1;
|
if (!pid) return -1;
|
||||||
_x_pid = atoi(pid);
|
_x_pid = atoi(pid);
|
||||||
|
|
||||||
exit_policy = getenv("ENTRANCE_FAST_QUIT");
|
|
||||||
|
|
||||||
action.sa_sigaction = _entrance_wait_action;
|
action.sa_sigaction = _entrance_wait_action;
|
||||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||||
|
@ -64,17 +61,8 @@ main (int argc __UNUSED__, char **argv __UNUSED__)
|
||||||
}
|
}
|
||||||
if (_x_pid == rpid)
|
if (_x_pid == rpid)
|
||||||
{
|
{
|
||||||
if (exit_policy)
|
if (WIFEXITED(status) && WEXITSTATUS(status))
|
||||||
{
|
setenv("ENTRANCE_QUIT", "1", 1);
|
||||||
setenv("ENTRANCE_QUIT", "1", 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( WIFEXITED(status) && WEXITSTATUS(status))
|
|
||||||
{
|
|
||||||
setenv("ENTRANCE_QUIT", "1", 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
execlp(PACKAGE_SBIN_DIR"/entrance", PACKAGE_SBIN_DIR"/entrance", "--nodaemon", NULL);
|
execlp(PACKAGE_SBIN_DIR"/entrance", PACKAGE_SBIN_DIR"/entrance", "--nodaemon", NULL);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue