improve fork handling
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 28 Sep 2009 23:49:02 +0000 (19:49 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 28 Sep 2009 23:49:02 +0000 (19:49 -0400)
libust/tracectl.c
libustcomm/ustcomm.c

index 51460d185e6c8378a87dc7c236df7ea97698ea12..faa471461c71c901b9399682ac019f0cb8fe1c13 100644 (file)
@@ -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);
        }
 
 
index 2e490b56b7f3b9bde99a3db8ade8b66f99f090da..6044c271fa7101d585261d44b1c24f401dfd2ef4 100644 (file)
@@ -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;
This page took 0.025061 seconds and 4 git commands to generate.