From: David Goulet Date: Wed, 20 Jul 2011 19:47:11 +0000 (-0400) Subject: Fix set but no use variables warnings X-Git-Tag: v2.0-pre2~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f40799e8d49a5e8161084fa98023f3e571b51962;p=lttng-tools.git Fix set but no use variables warnings Shown with gcc >= 4.6.0 Signed-off-by: David Goulet --- diff --git a/liblttkconsumerd/liblttkconsumerd.c b/liblttkconsumerd/liblttkconsumerd.c index e11229abd..99bf30eb4 100644 --- a/liblttkconsumerd/liblttkconsumerd.c +++ b/liblttkconsumerd/liblttkconsumerd.c @@ -651,6 +651,9 @@ static int kconsumerd_consumerd_recv_fd(int sfd, } /* signal the poll thread */ tmp2 = write(kconsumerd_poll_pipe[1], "4", 1); + if (tmp2 < 0) { + perror("write kconsumerd poll"); + } } else { ERR("Didn't received any fd"); kconsumerd_send_error(KCONSUMERD_ERROR_RECV_FD); @@ -762,6 +765,9 @@ void *kconsumerd_thread_poll_fds(void *data) if (pollfd[nb_fd].revents == POLLIN) { DBG("kconsumerd_poll_pipe wake up"); tmp2 = read(kconsumerd_poll_pipe[0], &tmp, 1); + if (tmp2 < 0) { + perror("read kconsumerd poll"); + } continue; } @@ -1020,6 +1026,9 @@ void kconsumerd_should_exit(void) int ret; kconsumerd_quit = 1; ret = write(kconsumerd_should_quit[1], "4", 1); + if (ret < 0) { + perror("write kconsumerd quit"); + } } /* diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index 78f916a85..8507523d3 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -1118,7 +1118,7 @@ error: */ static int start_kernel_trace(struct ltt_kernel_session *session) { - int ret; + int ret = 0; if (session->kconsumer_fds_sent == 0) { ret = send_kconsumerd_fds(kconsumerd_cmd_sock, session); @@ -1246,7 +1246,7 @@ static void list_lttng_sessions(struct lttng_session *sessions) */ static int process_client_msg(struct command_ctx *cmd_ctx) { - int ret; + int ret = LTTCOMM_OK; DBG("Processing client command %d", cmd_ctx->lsm->cmd_type); diff --git a/lttng/commands/list.c b/lttng/commands/list.c index 52c44eeb6..0b4afa308 100644 --- a/lttng/commands/list.c +++ b/lttng/commands/list.c @@ -89,6 +89,9 @@ static char *get_cmdline_by_pid(pid_t pid) /* Caller must free() *cmdline */ cmdline = malloc(PATH_MAX); ret = fread(cmdline, 1, PATH_MAX, fp); + if (ret < 0) { + perror("fread proc list"); + } fclose(fp); end: