Fix: remove assert on fd in the read/write layer
authorDavid Goulet <dgoulet@efficios.com>
Thu, 28 Nov 2013 18:25:25 +0000 (13:25 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 28 Nov 2013 18:25:25 +0000 (13:25 -0500)
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 <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/readwrite.c

index 0098f759b2d57dc156088126d457a86226517e65..7b8460962eda5ee7e917be20cce7c47be0a56ea4 100644 (file)
@@ -34,7 +34,6 @@ ssize_t lttng_read(int fd, void *buf, size_t count)
        size_t i = 0;
        ssize_t ret;
 
        size_t i = 0;
        ssize_t ret;
 
-       assert(fd >= 0);
        assert(buf);
 
        do {
        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;
 
        size_t i = 0;
        ssize_t ret;
 
-       assert(fd >= 0);
        assert(buf);
 
        do {
        assert(buf);
 
        do {
This page took 0.027617 seconds and 5 git commands to generate.