From 06cb3ad31a5241670d00af41020429a0e0d9865a Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 24 Oct 2008 14:11:56 +0000 Subject: [PATCH] Moved daemon() after channels_init() to make lttd return !0 on error. Applies on top of ltt-control-0.55-16102008. Signed-off-by: Zhao Lei git-svn-id: http://ltt.polymtl.ca/svn@3122 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/ltt-control/lttd/lttd.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/trunk/ltt-control/lttd/lttd.c b/trunk/ltt-control/lttd/lttd.c index cfbd71e..39a2fb7 100644 --- a/trunk/ltt-control/lttd/lttd.c +++ b/trunk/ltt-control/lttd/lttd.c @@ -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