Moved daemon() after channels_init() to make lttd return !0 on error.
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 24 Oct 2008 14:11:56 +0000 (14:11 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 24 Oct 2008 14:11:56 +0000 (14:11 +0000)
Applies on top of ltt-control-0.55-16102008.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
git-svn-id: http://ltt.polymtl.ca/svn@3122 04897980-b3bd-0310-b5e0-8ef037075253

trunk/ltt-control/lttd/lttd.c

index cfbd71e578a6b8ebbeb02ced80883a386eeeda3b..39a2fb781dd9bcb48329dc64d6faa331065edb6d 100644 (file)
@@ -911,15 +911,6 @@ int main(int argc, char ** argv)
 
        show_info();
 
-       if(daemon_mode) {
-               ret = daemon(0, 0);
-               
-               if(ret == -1) {
-                       perror("An error occured while daemonizing.");
-                       exit(-1);
-               }
-       }
-
        /* Connect the signal handlers */
        act.sa_handler = handler;
        act.sa_flags = 0;
@@ -934,6 +925,15 @@ int main(int argc, char ** argv)
        if(ret = channels_init())
                return ret;
 
+       if(daemon_mode) {
+               ret = daemon(0, 0);
+
+               if(ret == -1) {
+                       perror("An error occured while daemonizing.");
+                       exit(-1);
+               }
+       }
+
        tids = malloc(sizeof(pthread_t) * num_threads);
        for(i=0; i<num_threads; i++) {
 
This page took 0.02466 seconds and 4 git commands to generate.