From: David Goulet Date: Thu, 28 Nov 2013 18:25:25 +0000 (-0500) Subject: Fix: remove assert on fd in the read/write layer X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=043af8b55bfcc8276b7ae301efa2c72b1f3378e3 Fix: remove assert on fd in the read/write layer It is possible that an invalid fd is passed to read or write. This can happen for instance if the endpoint of the transport (ex: relayd) dies out while actively trying to send data. It is OK to let an invalid fd where the syscall will return the right value along with errno being populated with the corresponding code. Acked-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/src/common/readwrite.c b/src/common/readwrite.c index 0098f759b..7b8460962 100644 --- a/src/common/readwrite.c +++ b/src/common/readwrite.c @@ -34,7 +34,6 @@ ssize_t lttng_read(int fd, void *buf, size_t count) size_t i = 0; ssize_t ret; - assert(fd >= 0); assert(buf); do { @@ -64,7 +63,6 @@ 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 {