diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2018-10-09 15:17:57 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2018-10-11 05:15:28 +0000 |
commit | 23e96fd93c021d4647b940a47df2250fe9159a3b (patch) | |
tree | 0b02841e88c7aedd753d9cd8edb70ed6890ffe77 /rpc/rpc-transport | |
parent | 4511435fd353b98551be17d02e1d91e8896164ed (diff) |
socket: set FD_CLOEXEC on all sockets
For more information, see http://udrepper.livejournal.com/20407.html
BUG: 1236272
Change-Id: I25a645c10bdbe733a81d53cb714eb036251f8129
fixes: bz#1236272
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 94b03f913ab..753722cdb61 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -886,7 +886,7 @@ __socket_server_bind(rpc_transport_t *this) if (AF_UNIX == SA(&this->myinfo.sockaddr)->sa_family) { memcpy(&unix_addr, SA(&this->myinfo.sockaddr), this->myinfo.sockaddr_len); - reuse_check_sock = socket(AF_UNIX, SOCK_STREAM, 0); + reuse_check_sock = sys_socket(AF_UNIX, SOCK_STREAM, 0); if (reuse_check_sock >= 0) { ret = connect(reuse_check_sock, SA(&unix_addr), this->myinfo.sockaddr_len); @@ -3342,7 +3342,7 @@ socket_connect(rpc_transport_t *this, int port) memcpy(&this->peerinfo.sockaddr, &sock_union.storage, sockaddr_len); this->peerinfo.sockaddr_len = sockaddr_len; - priv->sock = socket(sa_family, SOCK_STREAM, 0); + priv->sock = sys_socket(sa_family, SOCK_STREAM, 0); if (priv->sock == -1) { gf_log(this->name, GF_LOG_ERROR, "socket creation failed (%s)", strerror(errno)); @@ -3614,7 +3614,7 @@ socket_listen(rpc_transport_t *this) memcpy(&myinfo->sockaddr, &sockaddr, sockaddr_len); myinfo->sockaddr_len = sockaddr_len; - priv->sock = socket(sa_family, SOCK_STREAM, 0); + priv->sock = sys_socket(sa_family, SOCK_STREAM, 0); if (priv->sock == -1) { gf_log(this->name, GF_LOG_ERROR, "socket creation failed (%s)", |