libs/nixio: fix possible issue with nonblocking bind()

This commit is contained in:
Jo-Philipp Wich 2011-08-11 23:15:05 +00:00
parent 5d0a48b5e0
commit 11ff9204cf
2 changed files with 3 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -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);