summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sock_stuff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sock_stuff.c b/src/sock_stuff.c
index b51d6ba..137375d 100644
--- a/src/sock_stuff.c
+++ b/src/sock_stuff.c
@@ -287,7 +287,10 @@ int recv_buf_timeout(int fd, void *data, size_t length, int flags,
// but this is an error condition
if (verbose >= 3)
fprintf(stderr, "%s: fd=%d recv returned 0\n", __func__, fd);
- return -1;
+ return -EAGAIN;
+ }
+ if (result < 0) {
+ return -errno;
}
return result;
}