summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-06-21 23:47:39 +0200
committerSergei Golubchik <serg@mariadb.org>2018-06-21 23:47:39 +0200
commitb942aa34c10ddfa3fe4977ae60afed5cbdc51083 (patch)
tree0a1a934ca7b728e3ffb81cd2f7c6a858524726d4 /include
parentfe3f9fa9183ea3d10397b6f7f4d422ae9bba00a4 (diff)
parentc09a8b5b36edb494e2bcc93074c06e26cd9f2b92 (diff)
downloadmariadb-git-b942aa34c10ddfa3fe4977ae60afed5cbdc51083.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h2
-rw-r--r--include/mysql/psi/mysql_socket.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h
index cdd4b503e70..65546a37700 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -598,6 +598,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC 0
+#else
+#define HAVE_SOCK_CLOEXEC
#endif
/* additional file share flags for win32 */
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index 64531e5c35e..6bc14e984fd 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -561,6 +561,12 @@ inline_mysql_socket_socket
(key, (const my_socket*)&mysql_socket.fd, NULL, 0);
}
#endif
+
+ /* SOCK_CLOEXEC isn't always a number - can't preprocessor compare */
+#if defined(HAVE_FCNTL) && defined(FD_CLOEXEC) && !defined(HAVE_SOCK_CLOEXEC)
+ (void) fcntl(mysql_socket.fd, F_SETFD, FD_CLOEXEC);
+#endif
+
return mysql_socket;
}