X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libustcomm%2Fustcomm.c;h=2bd86eb728442c2713f74cd24a30766706d731c8;hb=a2dc02e0e0a685b8814b68a2f07ce73c08e0ef50;hp=8b459df32975499a4c1137ee379fb9d40600b231;hpb=34b460e6b2180ef5e42cdc0455b3ac1a0afd912c;p=lttng-ust.git diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index 8b459df3..2bd86eb7 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -31,7 +31,7 @@ #include #include "ustcomm.h" -#include "localerr.h" +#include "usterr.h" #define UNIX_PATH_MAX 108 @@ -67,29 +67,18 @@ char *strdup_malloc(const char *s) static int signal_process(pid_t pid) { - int result; - - result = kill(pid, UST_SIGNAL); - if(result == -1) { - PERROR("kill"); - return -1; - } - - /* FIXME: should wait in a better way */ - //sleep(1); - return 0; } int pid_is_online(pid_t pid) { - return kill(pid, UST_SIGNAL) != -1; + return 1; } static int send_message_fd(int fd, const char *msg) { int result; - result = send(fd, msg, strlen(msg), 0); + result = send(fd, msg, strlen(msg), MSG_NOSIGNAL); if(result == -1) { PERROR("send"); return -1; @@ -406,7 +395,7 @@ int ustcomm_send_request(struct ustcomm_connection *conn, const char *req, char result = send(conn->fd, req, strlen(req), MSG_NOSIGNAL); if(result == -1) { - if(errno != ECONNRESET) + if(errno != EPIPE) PERROR("send"); return -1; } @@ -506,7 +495,7 @@ int ustcomm_init_app(pid_t pid, struct ustcomm_app *handle) handle->server.listen_fd = init_named_socket(name, &(handle->server.socketpath)); if(handle->server.listen_fd < 0) { - ERR("error initializing named socket"); + ERR("Error initializing named socket (%s). Check that directory exists and that it is writable.", name); goto free_name; } free(name);