From 15a5a49835f285c06f9c300f14922e9f19e8ec66 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 15 Jan 2020 02:40:43 +0000 Subject: [PATCH] e main - use exit code 111 to have e_start parent process restart e this means no leaked fd's between restarts too. cleaner. it also encorces "die with parent" for enlightenment_start too as another bonus in addition to its own fifo handling for singleton access per uid. WARNING: you need to log out and log back in since the "protocol expectations" (what exit codes do what and what parent and child process are responsible for) changed so to get them both back in sync you need to log out and in. --- src/bin/e_main.c | 6 ++---- src/bin/e_start_main.c | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 3738cb404..1367a0a4f 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -1142,10 +1142,8 @@ main(int argc, char **argv) if (restart) { - e_util_env_set("E_RESTART_OK", "1"); - if (getenv("E_START_MTRACK")) - e_util_env_set("MTRACK", "track"); - ecore_app_restart(); + e_system_shutdown(); + exit(111); // return code so e_start restrts e freshly } e_prefix_shutdown(); diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c index c967e2696..d4309b30d 100644 --- a/src/bin/e_start_main.c +++ b/src/bin/e_start_main.c @@ -727,6 +727,7 @@ main(int argc, char **argv) else if (child == 0) return _e_start_child(args, really_know); + putenv("E_RESTART_OK="); /* in the parent - ptrace attach and continue */ putenv("E_RESTART=1"); _e_ptrace_attach(child, &status, really_know); @@ -785,6 +786,12 @@ not_done: if (WEXITSTATUS(r) == 1) restart = EINA_FALSE; } + else if (WEXITSTATUS(status) == 111) + { + putenv("E_RESTART_OK=1"); + restart = EINA_TRUE; + done = EINA_TRUE; + } else if (!WIFEXITED(status) || stop_ptrace) done = EINA_TRUE; }