From: Bluezery <ohpowel@gmail.com>
[framework/uifw/elementary.git] / src / bin / quicklaunch.c
index 512497e..c9e6de9 100644 (file)
@@ -1,4 +1,7 @@
 #include <Elementary.h>
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -38,7 +41,7 @@ static int _log_dom = -1;
 #define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
 
 static void
-post_fork(void *data)
+post_fork(void *data __UNUSED__)
 {
    sigaction(SIGINT, &old_sigint, NULL);
    sigaction(SIGTERM, &old_sigterm, NULL);
@@ -61,16 +64,14 @@ post_fork(void *data)
 }
 
 static void
-child_handler(int x, siginfo_t *info, void *data)
+child_handler(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__)
 {
    int status;
-   pid_t pid;
-
-   while ((pid = waitpid(-1, &status, WNOHANG)) > 0);
+   while (waitpid(-1, &status, WNOHANG) > 0);
 }
 
 static void
-crash_handler(int x, siginfo_t *info, void *data)
+crash_handler(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__)
 {
    double t;
 
@@ -88,16 +89,16 @@ static void
 handle_run(int fd, unsigned long bytes)
 {
    unsigned char *buf = NULL;
-   int i, num;
+   int i;
    char **argv = NULL;
    char *cwd;
    int argc;
 
    buf = alloca(bytes);
-   if ((num = read(fd, buf, bytes)) < 0)
+   if (read(fd, buf, bytes) <= 0)
      {
-       close(fd);
-       return;
+        close(fd);
+        return;
      }
    close(fd);
    argc = ((unsigned long *)(buf))[0];
@@ -176,6 +177,7 @@ main(int argc, char **argv)
        CRITICAL("listen(sock=%d, 4096): %s", sock, strerror(errno));
        exit(-1);
      }
+   elm_quicklaunch_mode_set(EINA_TRUE);
    elm_quicklaunch_init(argc, argv);
    restart_time = ecore_time_get();
 
@@ -264,10 +266,11 @@ main(int argc, char **argv)
        struct sockaddr_un client;
        socklen_t len;
 
-       elm_quicklaunch_sub_init(argc, argv);
-       elm_quicklaunch_seed();
        len = sizeof(struct sockaddr_un);
        fd = accept(sock, (struct sockaddr *)&client, &len);
+       elm_quicklaunch_sub_init(argc, argv);
+// don't seed since we are doing this AFTER launch request        
+//     elm_quicklaunch_seed();
        if (fd >= 0)
          {
             unsigned long bytes;
@@ -280,7 +283,7 @@ main(int argc, char **argv)
                  handle_run(fd, bytes);
               }
          }
-       elm_quicklaunch_sub_shutdown();
+       while (elm_quicklaunch_sub_shutdown() > 0);
      }
    elm_quicklaunch_shutdown();