From 71b8773c3bc0d12222cb84731b95dedb8f4802e1 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 14 Dec 2023 07:17:30 +0900 Subject: [PATCH] Fix the use of incorrect options The value that should be set for flags of the fcntl() is FD_CLOEXEC. This patch modifies to use FD_CLOEXEC instead of O_CLOEXEC. Change-Id: I443a54ba18098d1bd2f094cdb081ad6b54fbd02b Signed-off-by: Hwankyu Jhun --- src/client-socket-internal.cc | 2 +- src/server-socket-internal.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client-socket-internal.cc b/src/client-socket-internal.cc index 8ba4ffb..08b2ae9 100644 --- a/src/client-socket-internal.cc +++ b/src/client-socket-internal.cc @@ -51,7 +51,7 @@ ClientSocket::~ClientSocket() { void ClientSocket::SetCloseOnExec() { int flags = fcntl(fd_, F_GETFL, 0); - fcntl(fd_, F_SETFL, flags | O_CLOEXEC); + fcntl(fd_, F_SETFL, flags | FD_CLOEXEC); _I("Close on exec. fd(%d)", fd_); } diff --git a/src/server-socket-internal.cc b/src/server-socket-internal.cc index a5b1640..ed01137 100644 --- a/src/server-socket-internal.cc +++ b/src/server-socket-internal.cc @@ -71,7 +71,7 @@ int ServerSocket::Listen(int backlog) { void ServerSocket::SetCloseOnExec() { int flags = fcntl(fd_, F_GETFL, 0); - fcntl(fd_, F_SETFL, flags | O_CLOEXEC); + fcntl(fd_, F_SETFL, flags | FD_CLOEXEC); _I("Close on exec. fd(%d)", fd_); } // LCOV_EXCL_STOP -- 2.7.4