From 60e57148f47eb3a3116de47e23516fc5df8c968e Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Mon, 28 Sep 2009 19:49:02 -0400 Subject: [PATCH] improve fork handling --- libust/tracectl.c | 6 ++++-- libustcomm/ustcomm.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libust/tracectl.c b/libust/tracectl.c index 51460d1..faa4714 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -1006,13 +1006,15 @@ static void __attribute__((constructor(1000))) init() return; } - inform_consumer_daemon(trace_name); - result = ltt_trace_start(trace_name); if(result < 0) { ERR("ltt_trace_start failed"); return; } + + /* Do this after the trace is started in order to avoid creating confusion + * if the trace fails to start. */ + inform_consumer_daemon(trace_name); } diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index 2e490b5..6044c27 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -89,7 +89,7 @@ static int send_message_fd(int fd, const char *msg) { int result; - result = send(fd, msg, strlen(msg), 0); + result = send(fd, msg, strlen(msg), MSG_NOSIGNAL); if(result == -1) { PERROR("send"); return -1; -- 2.34.1