From 043af8b55bfcc8276b7ae301efa2c72b1f3378e3 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 28 Nov 2013 13:25:25 -0500 Subject: [PATCH] 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 --- src/common/readwrite.c | 2 -- 1 file changed, 2 deletions(-) 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 { -- 2.34.1