mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[osdep] Restored changes.
This commit is contained in:
parent
dcfcd26d08
commit
154479e849
@ -77,6 +77,13 @@
|
||||
int
|
||||
set_nonblocking_fd(int fd)
|
||||
{
|
||||
#ifdef WIN32
|
||||
/* on current mingw (202204)
|
||||
* this is correct usage of winsock
|
||||
* when compiling for win32 */
|
||||
u_long mode = 1; // set non-blocking socket
|
||||
return ioctlsocket(fd, FIONBIO, &mode);
|
||||
# else
|
||||
#if defined(O_NONBLOCK) || defined(O_NDELAY)
|
||||
int flags = fcntl(fd, F_GETFL, 0);
|
||||
|
||||
@ -94,6 +101,8 @@ set_nonblocking_fd(int fd)
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Set a file descriptor to blocking mode. It returns a non-zero value on
|
||||
@ -101,6 +110,13 @@ set_nonblocking_fd(int fd)
|
||||
int
|
||||
set_blocking_fd(int fd)
|
||||
{
|
||||
#ifdef WIN32
|
||||
/* on current mingw (202204)
|
||||
* this is correct usage of winsock
|
||||
* when compiling for win32 */
|
||||
u_long mode = 0; // set blocking socket
|
||||
return ioctlsocket(fd, FIONBIO, &mode);
|
||||
# else
|
||||
#if defined(O_NONBLOCK) || defined(O_NDELAY)
|
||||
int flags = fcntl(fd, F_GETFL, 0);
|
||||
|
||||
@ -118,6 +134,7 @@ set_blocking_fd(int fd)
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user