diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2012-11-01 06:23:49 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2012-11-01 06:23:49 +0000 |
commit | 380386817b236cb79b34ec14e694b70ca820f722 (patch) | |
tree | e77169cbe98c8c6d409debe5f80addab7257af57 /src/bin/e_alert.c | |
parent | 0b5db2653e9ff5068df9569a381caf9e396cbbac (diff) | |
download | enlightenment-380386817b236cb79b34ec14e694b70ca820f722.tar.gz |
e: full rewrite of our WBOD.
NOTE: the new behaviour require a parent process,
here enlightenment_start, to watch over enlightenment.
It does use ptrace to monitor his child and track
what is going on. When a crash happen it ask gdb to
add the backtrace directly into .xsession-errors.
If you use systemd user session, you may want to offload
that work to systemd. You can do so, but don't forget to
pass -nopause to enlightenment when you start it.
WARNING: For all user, you will need to exit your
current session and start a fresh one for this new WBOD
to work at all. Just restarting Enlightenment will not
help you.
SVN revision: 78742
Diffstat (limited to 'src/bin/e_alert.c')
-rw-r--r-- | src/bin/e_alert.c | 60 |
1 files changed, 5 insertions, 55 deletions
diff --git a/src/bin/e_alert.c b/src/bin/e_alert.c index e24c63f99e..a38c2526ba 100644 --- a/src/bin/e_alert.c +++ b/src/bin/e_alert.c @@ -30,62 +30,12 @@ e_alert_composite_win(Ecore_X_Window root, Ecore_X_Window comp) } EAPI void -e_alert_show(int sig) +e_alert_show(void) { - char *args[4]; - pid_t pid; - -#define E_ALERT_EXE "/enlightenment/utils/enlightenment_alert" - - args[0] = alloca(strlen(e_prefix_lib_get()) + strlen(E_ALERT_EXE) + 1); - strcpy(args[0], e_prefix_lib_get()); - strcat(args[0], E_ALERT_EXE); - - args[1] = alloca(10); - snprintf(args[1], 10, "%d", sig); - - args[2] = alloca(21); - snprintf(args[2], 21, "%lu", (long unsigned int)getpid()); - - args[3] = NULL; - - pid = fork(); - if (pid < -1) - goto restart_e; - - if (pid == 0) - { - /* The child process */ - execvp(args[0], args); - } - else + if (!e_nopause) { - /* The parent process */ - pid_t ret; - int status = 0; - - do - { - ret = waitpid(pid, &status, 0); - if (errno == ECHILD) - break ; - } - while (ret != pid); - - if (status == 0) - goto restart_e; - - if (!WIFEXITED(status)) - goto restart_e; - - if (WEXITSTATUS(status) == 1) - goto restart_e; - - exit(-11); + fprintf(stderr, "PAUSE !\n"); + pause(); } - - restart_e: - if (getenv("E_START_MTRACK")) - e_util_env_set("MTRACK", "track"); - ecore_app_restart(); + return ; } |