Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: zhaolei@cn.fujitsu.com (Zhaolei)
Subject: [ltt-dev] [PATCH v2 1/2] Make lttcrl/lttd show error when channel not exist
Date: Wed, 22 Oct 2008 11:18:52 +0800	[thread overview]
Message-ID: <48FE9B9C.6090804@cn.fujitsu.com> (raw)
In-Reply-To: <20081021140518.GA19039@Krystal>

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++) {
 




  reply	other threads:[~2008-10-22  3:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21  5:39 [ltt-dev] PATCH] " Zhaolei
2008-10-21 14:05 ` Mathieu Desnoyers
2008-10-22  3:18   ` Zhaolei [this message]
2008-10-24 14:12     ` [ltt-dev] [PATCH v2 1/2] " Mathieu Desnoyers
2008-10-22  3:23   ` [ltt-dev] [PATCH v2 2/2] Add -v option for lttd Zhaolei
2008-10-24 14:15     ` Mathieu Desnoyers
2008-10-27  5:32       ` [ltt-dev] [PATCH v3] " Zhaolei
2008-10-28 14:27         ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48FE9B9C.6090804@cn.fujitsu.com \
    --to=zhaolei@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox