Add config.h support : will fix the LARGEFILE problem
[lttv.git] / ltt / branches / poly / lttctl / lttctl.c
index 1eeb1b1201adeb7b1fbca5c86653252b83a5d596..d392e8fa74eb31c7da57584f722763f93d6c2705 100644 (file)
@@ -8,6 +8,10 @@
  *     Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <libltt/libltt.h>
 #include <errno.h>
 #include <stdio.h>
@@ -32,9 +36,12 @@ static enum trace_ctl_op op = CTL_OP_NONE;
 static char *channel_root = NULL;
 static char *trace_root = NULL;
 
+static int sigio_received = 0;
+
 void handler(int signo)
 {
        printf("signal %d received\n", signo);
+       sigio_received = 1;
 }
 
 
@@ -220,12 +227,13 @@ int lttctl_daemon(struct lttctl_handle *handle, char *trace_name)
        sigaddset(&(act.sa_mask), SIGIO);
        sigaction(SIGIO, &act, NULL);
        
+       sigio_received = 0;
+       
        pid = fork();
 
        if(pid > 0) {
-               //sleep(1);
                /* parent */
-               pause();
+               while(!sigio_received) pause();
 
                /* Now the trace is created, go on and create the supplementary files... */
                printf("Creating supplementary trace files\n");
This page took 0.028553 seconds and 4 git commands to generate.