X-Git-Url: http://git.lttng.org/?p=ust.git;a=blobdiff_plain;f=libustcomm%2Fustcomm.c;h=004cdb001f340e355574c87679f5f82bedf81b41;hp=e19118347ce3fd364aa1ec75cadb0f74fcf20550;hb=52c51a47e4b002d741c89de8dc786da59e894a1a;hpb=a32e24a598469d479bfe6c96de985e4353fb09d5 diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index e191183..004cdb0 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -49,18 +49,20 @@ char *strdup_malloc(const char *s) return retval; } -static void signal_process(pid_t pid) +static int signal_process(pid_t pid) { int result; result = kill(pid, UST_SIGNAL); if(result == -1) { PERROR("kill"); - return; + return -1; } /* FIXME: should wait in a better way */ - sleep(1); + //sleep(1); + + return 0; } static int send_message_fd(int fd, const char *msg) @@ -113,8 +115,13 @@ static int send_message_path(const char *path, const char *msg, int signalpid) return -1; } - if(signalpid >= 0) - signal_process(signalpid); + if(signalpid >= 0) { + result = signal_process(signalpid); + if(result == -1) { + ERR("could not signal process"); + return -1; + } + } result = connect(fd, (struct sockaddr *)&addr, sizeof(addr)); if(result == -1) { @@ -438,8 +445,13 @@ int ustcomm_connect_path(char *path, struct ustcomm_connection *conn, pid_t sign return -1; } - if(signalpid >= 0) - signal_process(signalpid); + if(signalpid >= 0) { + result = signal_process(signalpid); + if(result == -1) { + ERR("could not signal process"); + return -1; + } + } result = connect(fd, (struct sockaddr *)&addr, sizeof(addr)); if(result == -1) {