diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-14 15:10:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-14 15:10:59 +0300 |
commit | 646a6005e7882f9d4baf516c7936e5ef88ea89a6 (patch) | |
tree | d5b348bec9d756be164dd83fa052b80512f77e2f /include | |
parent | 6b6c012f330cbbdcdee32333f16813764e5ed466 (diff) | |
parent | 67a03b7c947f5a0cfddbe1acc5e560fc737b0848 (diff) | |
download | mariadb-git-646a6005e7882f9d4baf516c7936e5ef88ea89a6.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'include')
-rw-r--r-- | include/mysql/psi/mysql_socket.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h index 88991e62632..918acb65ebe 100644 --- a/include/mysql/psi/mysql_socket.h +++ b/include/mysql/psi/mysql_socket.h @@ -1043,10 +1043,14 @@ inline_mysql_socket_accept #else socket_accept.fd= accept(socket_listen.fd, addr, &addr_length); #ifdef FD_CLOEXEC - flags= fcntl(socket_accept.fd, F_GETFD); - if (flags != -1) { - flags |= FD_CLOEXEC; - fcntl(socket_accept.fd, F_SETFD, flags); + if (socket_accept.fd != INVALID_SOCKET) + { + flags= fcntl(socket_accept.fd, F_GETFD); + if (flags != -1) + { + flags |= FD_CLOEXEC; + fcntl(socket_accept.fd, F_SETFD, flags); + } } #endif #endif @@ -1065,10 +1069,14 @@ inline_mysql_socket_accept #else socket_accept.fd= accept(socket_listen.fd, addr, &addr_length); #ifdef FD_CLOEXEC - flags= fcntl(socket_accept.fd, F_GETFD); - if (flags != -1) { - flags |= FD_CLOEXEC; - fcntl(socket_accept.fd, F_SETFD, flags); + if (socket_accept.fd != INVALID_SOCKET) + { + flags= fcntl(socket_accept.fd, F_GETFD); + if (flags != -1) + { + flags |= FD_CLOEXEC; + fcntl(socket_accept.fd, F_SETFD, flags); + } } #endif #endif |