implement ff_socket_nonblock and use it in networking code
Originally committed as revision 8846 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -114,6 +114,14 @@ int resolve_host(struct in_addr *sin_addr, const char *hostname)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_socket_nonblock(int socket, int enable)
|
||||
{
|
||||
if (enable)
|
||||
return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK);
|
||||
else
|
||||
return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK);
|
||||
}
|
||||
#endif /* CONFIG_NETWORK */
|
||||
|
||||
#ifdef CONFIG_FFSERVER
|
||||
|
Reference in New Issue
Block a user