Fix: add asserts and remove unused variable
authorDavid Goulet <dgoulet@efficios.com>
Mon, 11 Nov 2013 19:42:06 +0000 (14:42 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 11 Nov 2013 20:06:11 +0000 (15:06 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/main.c
src/common/readwrite.c

index a81bca69534b4baa100c898e0ab6c1f525070262..3bf91b0faf2a0bda9b8d8d56d57af19d61d32d87 100644 (file)
@@ -782,7 +782,6 @@ static void update_ust_app(int app_sock)
 static void *thread_manage_kernel(void *data)
 {
        int ret, i, pollfd, update_poll_flag = 1, err = -1;
-       ssize_t size_ret;
        uint32_t revents, nb_fd;
        char tmp;
        struct lttng_poll_event events;
index a559de76b1ea5f85387ab178eee47a21b7f101f1..0098f759b2d57dc156088126d457a86226517e65 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <unistd.h>
-#include <errno.h>
 #include <assert.h>
+#include <errno.h>
+#include <unistd.h>
+
 #include "readwrite.h"
 
 /*
@@ -33,6 +34,9 @@ ssize_t lttng_read(int fd, void *buf, size_t count)
        size_t i = 0;
        ssize_t ret;
 
+       assert(fd >= 0);
+       assert(buf);
+
        do {
                ret = read(fd, buf + i, count - i);
                if (ret < 0) {
@@ -60,6 +64,9 @@ ssize_t lttng_write(int fd, const void *buf, size_t count)
        size_t i = 0;
        ssize_t ret;
 
+       assert(fd >= 0);
+       assert(buf);
+
        do {
                ret = write(fd, buf + i, count - i);
                if (ret < 0) {
This page took 0.029263 seconds and 4 git commands to generate.