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.
This commit is contained in:
Carsten Haitzler 2020-01-15 02:40:43 +00:00
parent a43869cdc0
commit 15a5a49835
2 changed files with 9 additions and 4 deletions

View File

@ -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();

View File

@ -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;
}