From: David Goulet Date: Mon, 11 Nov 2013 19:42:06 +0000 (-0500) Subject: Fix: add asserts and remove unused variable X-Git-Tag: v2.4.0-rc1~57 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=aeb162609d6ef1f16ec0e818d3750eb6dfff8b30;p=lttng-tools.git Fix: add asserts and remove unused variable Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index a81bca695..3bf91b0fa 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -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; diff --git a/src/common/readwrite.c b/src/common/readwrite.c index a559de76b..0098f759b 100644 --- a/src/common/readwrite.c +++ b/src/common/readwrite.c @@ -15,9 +15,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include +#include +#include + #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) {