improve create_listener()
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 13 Oct 2009 21:20:07 +0000 (17:20 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 13 Oct 2009 21:20:07 +0000 (17:20 -0400)
libust/tracectl.c

index dbd39657e6f507585b8f2e9c4a29115dd96917e4..2d4341d3b418cd4957b8ab2efc95fbf564f6520e 100644 (file)
@@ -774,15 +774,18 @@ void create_listener(void)
 {
 #ifdef USE_CLONE
        static char listener_stack[16384];
+       int result;
 #else
        pthread_t thread;
 #endif
 
-       if(have_listener)
+       if(have_listener) {
+               WARN("not creating listener because we already had one");
                return;
+       }
 
 #ifdef USE_CLONE
-       result = clone(listener_main, listener_stack+sizeof(listener_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM | CLONE_SIGHAND | CLONE_THREAD, NULL);
+       result = clone((int (*)(void *)) listener_main, listener_stack+sizeof(listener_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM | CLONE_SIGHAND | CLONE_THREAD, NULL);
        if(result == -1) {
                perror("clone");
                return;
This page took 0.024781 seconds and 4 git commands to generate.