diff options
| author | daurnimator <quae@daurnimator.com> | 2014-10-27 11:10:48 -0400 |
|---|---|---|
| committer | daurnimator <quae@daurnimator.com> | 2014-10-27 13:35:36 -0400 |
| commit | e602c2b271c4efdd0f9138863fb16f5b790fb824 (patch) | |
| tree | 56dae750ab3c06381a13f10e205fcf3066cced64 /src | |
| parent | d80bb0d82ba105c8fdb27e6174c267965d06ffb0 (diff) | |
| download | luasocket-e602c2b271c4efdd0f9138863fb16f5b790fb824.tar.gz luasocket-e602c2b271c4efdd0f9138863fb16f5b790fb824.tar.bz2 luasocket-e602c2b271c4efdd0f9138863fb16f5b790fb824.zip | |
src/usocket: Do not setblocking on destroy;
This results in unexpected behaviour if the socket has been `dup()`d, as O_NONBLOCK is shared.
Close is always 'blocking' anyway
See https://github.com/wahern/cqueues/issues/13 for an example use case
Diffstat (limited to 'src')
| -rw-r--r-- | src/usocket.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/usocket.c b/src/usocket.c index 096ecd0..ca483f4 100644 --- a/src/usocket.c +++ b/src/usocket.c | |||
| @@ -92,7 +92,6 @@ int socket_close(void) { | |||
| 92 | \*-------------------------------------------------------------------------*/ | 92 | \*-------------------------------------------------------------------------*/ |
| 93 | void socket_destroy(p_socket ps) { | 93 | void socket_destroy(p_socket ps) { |
| 94 | if (*ps != SOCKET_INVALID) { | 94 | if (*ps != SOCKET_INVALID) { |
| 95 | socket_setblocking(ps); | ||
| 96 | close(*ps); | 95 | close(*ps); |
| 97 | *ps = SOCKET_INVALID; | 96 | *ps = SOCKET_INVALID; |
| 98 | } | 97 | } |
