From 6661997701aef9f609465b3a1863cf03402bc06a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 18 Jul 2017 12:50:15 +0200 Subject: swrap: set errno to ENFILE if there is no more free socket_info Signed-off-by: Michael Adam Reviewed-by: Andreas Schneider --- src/socket_wrapper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 61f0f6e..12dfb74 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -1368,6 +1368,7 @@ static int socket_wrapper_first_free_index(void) int next_free; if (first_free == -1) { + errno = ENFILE; return -1; } @@ -2897,7 +2898,6 @@ static int swrap_socket(int family, int type, int protocol) idx = socket_wrapper_first_free_index(); if (idx == -1) { - errno = ENOMEM; return -1; } @@ -3113,7 +3113,6 @@ static int swrap_accept(int s, idx = socket_wrapper_first_free_index(); if (idx == -1) { - errno = ENOMEM; return -1; } -- cgit v1.2.3