From: Pierre-Marc Fournier Date: Tue, 13 Oct 2009 21:20:07 +0000 (-0400) Subject: improve create_listener() X-Git-Tag: v1.9.1~866 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c5fdc88852bc232e24fb3941ea5d5719b4490a87;p=lttng-ust.git improve create_listener() --- diff --git a/libust/tracectl.c b/libust/tracectl.c index dbd39657..2d4341d3 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -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;