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:
Alex Beregszaszi
2007-04-27 00:41:50 +00:00
parent 8da4034f52
commit ba472aaf01
4 changed files with 13 additions and 4 deletions

View File

@ -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