Fix set but no use variables warnings
authorDavid Goulet <david.goulet@polymtl.ca>
Wed, 20 Jul 2011 19:47:11 +0000 (15:47 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Wed, 20 Jul 2011 19:47:16 +0000 (15:47 -0400)
Shown with gcc >= 4.6.0

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
liblttkconsumerd/liblttkconsumerd.c
ltt-sessiond/main.c
lttng/commands/list.c

index e11229abd5dca98661aa653be113c6b74a6e088c..99bf30eb4c0d6a2f430087ecd52b309bfb3fc388 100644 (file)
@@ -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");
+       }
 }
 
 /*
index 78f916a854f11f06139138a04c4dd35f6d60556f..8507523d353ed89aed861fc3daacc4cae7437f76 100644 (file)
@@ -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);
 
index 52c44eeb652a73f638d0c8182426a62fdf84bbf6..0b4afa308047b3ce951b27c2519494b61f1bf269 100644 (file)
@@ -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:
This page took 0.035838 seconds and 4 git commands to generate.