diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-11-17 15:08:32 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-11-21 15:43:19 +0300 |
commit | 87ab1ec7f7e4f31c95fedfdfffa5a940e9d1bcdc (patch) | |
tree | 6158516c196198f7c2286b656ec346e8e646de41 /doc/examples | |
parent | 3b950aef4d0398cf07b525fe7b13a3305dc5d46f (diff) | |
download | libmicrohttpd-87ab1ec7f7e4f31c95fedfdfffa5a940e9d1bcdc.tar.gz libmicrohttpd-87ab1ec7f7e4f31c95fedfdfffa5a940e9d1bcdc.zip |
test and examples: check socket control functions results
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/websocket.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/examples/websocket.c b/doc/examples/websocket.c index fad1e95f..4fa6f4ed 100644 --- a/doc/examples/websocket.c +++ b/doc/examples/websocket.c | |||
@@ -286,15 +286,16 @@ make_blocking (MHD_socket fd) | |||
286 | 286 | ||
287 | flags = fcntl (fd, F_GETFL); | 287 | flags = fcntl (fd, F_GETFL); |
288 | if (-1 == flags) | 288 | if (-1 == flags) |
289 | return; | 289 | abort (); |
290 | if ((flags & ~O_NONBLOCK) != flags) | 290 | if ((flags & ~O_NONBLOCK) != flags) |
291 | if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK)) | 291 | if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK)) |
292 | abort (); | 292 | abort (); |
293 | #else | 293 | #else /* _WIN32 */ |
294 | unsigned long flags = 0; | 294 | unsigned long flags = 0; |
295 | 295 | ||
296 | ioctlsocket (fd, FIONBIO, &flags); | 296 | if (0 != ioctlsocket (fd, (int) FIONBIO, &flags)) |
297 | #endif | 297 | abort (); |
298 | #endif /* _WIN32 */ | ||
298 | } | 299 | } |
299 | 300 | ||
300 | 301 | ||