예제 #1
0
EAPI void
e_alert_show(int sig)
{
    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] = alloca(21);
    snprintf(args[3], 21, "%lu", e_alert_composite_win);

    pid = fork();
    if (pid < -1)
        goto restart_e;

    if (pid == 0)
    {
        /* The child process */
        execvp(args[0], args);
    }
    else
    {
        /* 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);
    }

restart_e:
    ecore_app_restart();
}
예제 #2
0
파일: e_init.c 프로젝트: hippytaff/Enform
EAPI void
e_init_show(void)
{
   char buf[8192], *theme, *tit, *ver;
   const char *s = NULL;

   /* exec init */

   if (!e_config->init_default_theme)
     s = e_path_find(path_themes, "default.edj");
   else if (e_config->init_default_theme[0] == '/')
     s = eina_stringshare_add(e_config->init_default_theme);
   else
     s = e_path_find(path_themes, e_config->init_default_theme);

   if (s) theme = strdup(e_util_filename_escape(s));
   else theme = strdup("XdX");
   if (s) eina_stringshare_del(s);

   if (title) tit = strdup(e_util_filename_escape(title));
   else tit = strdup("XtX");

   if (version) ver = strdup(e_util_filename_escape(version));
   else ver = strdup("XvX");

   snprintf(buf, sizeof(buf),
            "%s/enform/utils/enform_init \'%s\' \'%i\' \'%s\' \'%s\'",
            e_prefix_lib_get(), theme,
            e_config->font_hinting, tit, ver);
   printf("RUN INIT: %s\n", buf);
   free(theme);
   free(tit);
   free(ver);
   /* FIXME: add font path to cmd-line */
   init_exe = ecore_exe_run(buf, NULL);
}
예제 #3
0
$NetBSD$

Explicitly exec enlightenment_init, to make sure it becomes the
direct child, and not the shell running it. Else the splash screen
keeps running. (Doesn't happen with bash, which would exec anyway.)

--- src/bin/e_init.c.orig
+++ src/bin/e_init.c
@@ -68,7 +68,7 @@ e_init_show(void)
    else ver = strdup("XvX");
 
    snprintf(buf, sizeof(buf),
-            "%s/enlightenment/utils/enlightenment_init \'%s\' \'%i\' \'%s\' \'%s\'",
+            "exec %s/enlightenment/utils/enlightenment_init \'%s\' \'%i\' \'%s\' \'%s\'",
             e_prefix_lib_get(), theme,
             e_config->font_hinting, tit, ver);
    printf("RUN INIT: %s\n", buf);