summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-12 09:52:51 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-12 09:58:06 +0100
commite0227cf536b2fe96a442588749b3a42d61645584 (patch)
tree44dc9c487110600ea6cf802f0afc58ca2fdc367c /src
parent609c79de1fc511560a50ba8e61d23286a279deff (diff)
e start - handle exit code for restart AND exit choices because of lib
so library somewhere is causing an exit(1) sometimes... this means i lose my entire desktop. this is not e doing it... so it's some dependency bug and this shouldn't happen - but it does and it causes the entire login session to be losst, so treat an exit code ofr 0 as a clean exit, and anything else as a bug to be handled like segfaults etc. and restart e.
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_start_main.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c
index a89919909..a18f4daa9 100644
--- a/src/bin/e_start_main.c
+++ b/src/bin/e_start_main.c
@@ -814,7 +814,10 @@ not_done:
814 814
815 if (result == child) 815 if (result == child)
816 { 816 {
817 if (WIFSTOPPED(status) && !stop_ptrace) 817 printf("WIFSTOPPED=%i WIFEXITED=%i WEXITSTATUS=%i stop_ptrace=%i\n",
818 WIFSTOPPED(status), WIFEXITED(status),
819 WEXITSTATUS(status), stop_ptrace);
820 if (WIFSTOPPED(status) && (!stop_ptrace))
818 { 821 {
819 char *backtrace_str = NULL; 822 char *backtrace_str = NULL;
820 823
@@ -855,14 +858,28 @@ not_done:
855 if (getenv("DISPLAY")) kill(child, SIGKILL); 858 if (getenv("DISPLAY")) kill(child, SIGKILL);
856 if (WEXITSTATUS(r) == 1) restart = EINA_FALSE; 859 if (WEXITSTATUS(r) == 1) restart = EINA_FALSE;
857 } 860 }
861 else if (!WIFEXITED(status) || (stop_ptrace))
862 {
863 restart = EINA_TRUE;
864 done = EINA_TRUE;
865 }
858 else if (WEXITSTATUS(status) == 111) 866 else if (WEXITSTATUS(status) == 111)
859 { 867 {
860 putenv("E_RESTART_OK=1"); 868 putenv("E_RESTART_OK=1");
861 restart = EINA_TRUE; 869 restart = EINA_TRUE;
862 done = EINA_TRUE; 870 done = EINA_TRUE;
863 } 871 }
864 else if (!WIFEXITED(status) || stop_ptrace) 872 else if (WEXITSTATUS(status) == 0)
865 done = EINA_TRUE; 873 {
874 restart = EINA_FALSE;
875 done = EINA_TRUE;
876 }
877 else
878 {
879 printf("Invalid exit from enlightenment: code=%i\n", WEXITSTATUS(status));
880 restart = EINA_TRUE;
881 done = EINA_TRUE;
882 }
866 } 883 }
867 else if (result == -1) 884 else if (result == -1)
868 { 885 {