Fix the use of incorrect options
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 13 Dec 2023 22:17:30 +0000 (07:17 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 13 Dec 2023 23:22:34 +0000 (08:22 +0900)
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 <h.jhun@samsung.com>
src/client-socket-internal.cc
src/server-socket-internal.cc

index 2e8fd95bb66631c943cc97cf5292062fe34b2fe4..9280782d27f223ff21a80f07f0f3f5df706d382f 100644 (file)
@@ -49,7 +49,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_);
 }
 
index 5f58e34d0d7f4122d1dbc367d39b8b9ff0eb18bc..908359d7aa2ed48c098a6dbd5eb6ef7957297294 100644 (file)
@@ -70,7 +70,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_);
 }