utils: removed function set_nonblocking()
It's not used anymore, its features have been moved to fd_util.c.
This commit is contained in:
parent
f66edccffd
commit
2f4144e1cd
30
src/utils.c
30
src/utils.c
@ -102,36 +102,6 @@ char *parsePath(char *path)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int set_nonblocking(int fd)
|
|
||||||
{
|
|
||||||
#ifdef WIN32
|
|
||||||
u_long val = 1;
|
|
||||||
int retval;
|
|
||||||
int lasterr = 0;
|
|
||||||
retval = ioctlsocket(fd, FIONBIO, &val);
|
|
||||||
if(retval == SOCKET_ERROR)
|
|
||||||
g_error("Error: ioctlsocket could not set FIONBIO;"
|
|
||||||
" Error %d on socket %d", lasterr = WSAGetLastError(), fd);
|
|
||||||
if(lasterr == 10038)
|
|
||||||
g_debug("Code-up error! Attempt to set non-blocking I/O on "
|
|
||||||
"something that is not a Winsock2 socket. This can't "
|
|
||||||
"be done on Windows!\n");
|
|
||||||
return retval;
|
|
||||||
#else
|
|
||||||
int ret, flags;
|
|
||||||
|
|
||||||
assert(fd >= 0);
|
|
||||||
|
|
||||||
while ((flags = fcntl(fd, F_GETFL)) < 0 && errno == EINTR) ;
|
|
||||||
if (flags < 0)
|
|
||||||
return flags;
|
|
||||||
|
|
||||||
flags |= O_NONBLOCK;
|
|
||||||
while ((ret = fcntl(fd, F_SETFL, flags)) < 0 && errno == EINTR) ;
|
|
||||||
return ret;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
string_array_contains(const char *const* haystack, const char *needle)
|
string_array_contains(const char *const* haystack, const char *needle)
|
||||||
{
|
{
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
char *parsePath(char *path);
|
char *parsePath(char *path);
|
||||||
|
|
||||||
int set_nonblocking(int fd);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether a string array contains the specified string.
|
* Checks whether a string array contains the specified string.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user