Permalink
Browse files

bug 2600 - fcntl() F_GETFL was lying on windows

The bad effect was that all sockets on windows ended up being
incorrectly in blocking mode instead of non-blocking mode,
after doing a sasl-auth.

Change-Id: I06d8a1447b33bbeef4aa35bf119a9c448e635a55
Reviewed-on: http://review.northscale.com/3047
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
1 parent 2be151b commit 036e93d8300b21cce37572defeb5a4f4d28239af @steveyen steveyen committed Oct 5, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 mcs.c
View
@@ -593,15 +593,15 @@ mcs_return mcs_io_read(int fd, void *dta, size_t size) {
while (done < size) {
ssize_t n = read(fd, data + done, size - done);
if (n == -1) {
- fcntl(fd, F_SETFL, flags);
+ fcntl(fd, F_SETFL, flags | O_NONBLOCK);
return MCS_FAILURE;
}
done += (size_t) n;
}
- fcntl(fd, F_SETFL, flags);
+ fcntl(fd, F_SETFL, flags | O_NONBLOCK);
return MCS_SUCCESS;
}

0 comments on commit 036e93d

Please sign in to comment.