From c5fdc88852bc232e24fb3941ea5d5719b4490a87 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Tue, 13 Oct 2009 17:20:07 -0400 Subject: [PATCH] improve create_listener() --- libust/tracectl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libust/tracectl.c b/libust/tracectl.c index dbd3965..2d4341d 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; -- 2.34.1