[ltt-dev] [PATCH v2 1/2] Make lttcrl/lttd show error when channel not exist

Zhaolei zhaolei at cn.fujitsu.com
Tue Oct 21 23:18:52 EDT 2008


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 <zhaolei at cn.fujitsu.com>
---
diff -Nur ltt-control-0.54-10102008.org/lttd/lttd.c ltt-control-0.54-10102008/lttd/lttd.c
--- ltt-control-0.54-10102008.org/lttd/lttd.c	2008-10-15 15:29:54.000000000 +0800
+++ ltt-control-0.54-10102008/lttd/lttd.c	2008-10-21 13:15:06.000000000 +0800
@@ -911,15 +911,6 @@
 
 	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 @@
 	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++) {
 





More information about the lttng-dev mailing list