summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-08-11 23:15:05 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-08-11 23:15:05 +0000
commit11ff9204cf9b2fd451bf8e0e0dd3fe3f078c2808 (patch)
treeb7e4dc8379e95f1d00127320caeb01210a937cb1 /libs/nixio
parent5d0a48b5e007e2ff8291fff07a40e7b382fdf980 (diff)
libs/nixio: fix possible issue with nonblocking bind()
Diffstat (limited to 'libs/nixio')
-rw-r--r--libs/nixio/src/bind.c2
-rw-r--r--libs/nixio/src/nixio.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/libs/nixio/src/bind.c b/libs/nixio/src/bind.c
index 81ab0bb48..711205955 100644
--- a/libs/nixio/src/bind.c
+++ b/libs/nixio/src/bind.c
@@ -180,7 +180,7 @@ static int nixio_sock__bind_connect(lua_State *L, int do_bind) {
}
/* on success */
- if (!status) {
+ if (!status || errno == EINPROGRESS) {
break;
}
}
diff --git a/libs/nixio/src/nixio.c b/libs/nixio/src/nixio.c
index f6e8e184c..70a77b4c9 100644
--- a/libs/nixio/src/nixio.c
+++ b/libs/nixio/src/nixio.c
@@ -198,6 +198,8 @@ NIXIO_API int luaopen_nixio(lua_State *L) {
NIXIO_PUSH_CONSTANT(SIGSEGV);
#ifndef __WINNT__
+ NIXIO_PUSH_CONSTANT(EALREADY);
+ NIXIO_PUSH_CONSTANT(EINPROGRESS);
NIXIO_PUSH_CONSTANT(EWOULDBLOCK);
NIXIO_PUSH_CONSTANT(ELOOP);
NIXIO_PUSH_CONSTANT(EOVERFLOW);