[sane-devel] [PATCH v2 10/14] net, implement O_NONBLOCK stuff for win32

Ruediger Meier sweet_f_a at gmx.de
Mon Jan 23 23:05:55 UTC 2012


From: Ruediger Meier <ruediger.meier at ga-group.nl>

---
 backend/net.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/backend/net.c b/backend/net.c
index 5946a1b..03133d3 100644
--- a/backend/net.c
+++ b/backend/net.c
@@ -2363,7 +2363,12 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
       return SANE_STATUS_INVAL;
     }
 
+#if ! defined _WIN32
   if (fcntl (s->data, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0)
+#else
+  u_long iMode = non_blocking;
+  if (ioctlsocket(s->data, FIONBIO, &iMode) != NO_ERROR)
+#endif
     {
       DBG (1, "sane_set_io_mode: fcntl failed (%s)\n", strerror (errno));
       return SANE_STATUS_IO_ERROR;
-- 
1.7.6.1




More information about the sane-devel mailing list