aboutsummaryrefslogtreecommitdiff
path: root/src/usocket.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-21 06:07:58 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-21 06:07:58 +0000
commitbce1cb30d856d167e167c4c2997f9bebe03a612c (patch)
tree8e684b912cdc9d27c5aebf593107487c94866438 /src/usocket.c
parentf7579db9e830ef41f422a280d26c9077f48728e5 (diff)
downloadluasocket-bce1cb30d856d167e167c4c2997f9bebe03a612c.tar.gz
luasocket-bce1cb30d856d167e167c4c2997f9bebe03a612c.tar.bz2
luasocket-bce1cb30d856d167e167c4c2997f9bebe03a612c.zip
More adjustments/bugfixes.
Diffstat (limited to 'src/usocket.c')
-rw-r--r--src/usocket.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/usocket.c b/src/usocket.c
index ea0f172..617b1ea 100644
--- a/src/usocket.c
+++ b/src/usocket.c
@@ -81,7 +81,6 @@ const char *sock_create(p_sock ps, int domain, int type, int protocol)
81 t_sock sock = socket(domain, type, protocol); 81 t_sock sock = socket(domain, type, protocol);
82 if (sock == SOCK_INVALID) return sock_createstrerror(errno); 82 if (sock == SOCK_INVALID) return sock_createstrerror(errno);
83 *ps = sock; 83 *ps = sock;
84 sock_setnonblocking(ps);
85 return NULL; 84 return NULL;
86} 85}
87 86
@@ -178,10 +177,7 @@ const char *sock_accept(p_sock ps, p_sock pa, SA *addr,
178 do *pa = accept(sock, addr, addr_len); 177 do *pa = accept(sock, addr, addr_len);
179 while (*pa < 0 && errno == EINTR); 178 while (*pa < 0 && errno == EINTR);
180 /* if result is valid, we are done */ 179 /* if result is valid, we are done */
181 if (*pa != SOCK_INVALID) { 180 if (*pa != SOCK_INVALID) return NULL;
182 sock_setnonblocking(pa);
183 return NULL;
184 }
185 /* find out if we failed for a fatal reason */ 181 /* find out if we failed for a fatal reason */
186 if (errno != EWOULDBLOCK && errno != ECONNABORTED) 182 if (errno != EWOULDBLOCK && errno != ECONNABORTED)
187 return sock_acceptstrerror(errno); 183 return sock_acceptstrerror(errno);