1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: test return code when reading flags with fcntl (set flags to 0 if error)

This commit is contained in:
Sebastien Helleu
2012-06-01 10:33:30 +02:00
parent 3209ebcb27
commit f56a936b22
+2
View File
@@ -958,6 +958,8 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
*/
HOOK_CONNECT(hook_connect, handshake_fd_flags) =
fcntl (HOOK_CONNECT(hook_connect, sock), F_GETFL);
if (HOOK_CONNECT(hook_connect, handshake_fd_flags) == -1)
HOOK_CONNECT(hook_connect, handshake_fd_flags) = 0;
fcntl (HOOK_CONNECT(hook_connect, sock), F_SETFL,
HOOK_CONNECT(hook_connect, handshake_fd_flags) | O_NONBLOCK);
gnutls_transport_set_ptr (*HOOK_CONNECT(hook_connect, gnutls_sess),