aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2017-07-18 12:50:15 +0200
committerAndreas Schneider <asn@samba.org>2018-05-02 14:23:34 +0200
commit6661997701aef9f609465b3a1863cf03402bc06a (patch)
tree09f442d90c608231eb55cebdcd9ce840392ff6e8 /src
parentaec1e1207d70f1b2a12a3cb3641691bb99ba7581 (diff)
downloadsocket_wrapper-6661997701aef9f609465b3a1863cf03402bc06a.tar.gz
socket_wrapper-6661997701aef9f609465b3a1863cf03402bc06a.tar.xz
socket_wrapper-6661997701aef9f609465b3a1863cf03402bc06a.zip
swrap: set errno to ENFILE if there is no more free socket_info
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/socket_wrapper.c3
1 files changed, 1 insertions, 2 deletions
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;
}