From: Steinar H. Gunderson Date: Sun, 2 Apr 2023 20:25:09 +0000 (+0200) Subject: Fix yet more stupid close-on-exec bugs. X-Git-Tag: 1.5.0~12 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=757d3a3a170faf4c30115df1cea43a47a425add5 Fix yet more stupid close-on-exec bugs. --- diff --git a/acceptor.cpp b/acceptor.cpp index 31901dd..75dd70b 100644 --- a/acceptor.cpp +++ b/acceptor.cpp @@ -104,7 +104,7 @@ Acceptor::Acceptor(const AcceptorProto &serialized) { // Set back the close-on-exec flag for the socket. // (This can't leak into a child, since we haven't been started yet.) - fcntl(server_sock, F_SETFD, O_CLOEXEC); + fcntl(server_sock, F_SETFD, FD_CLOEXEC); } AcceptorProto Acceptor::serialize() const diff --git a/client.cpp b/client.cpp index 5d5c179..fb278e2 100644 --- a/client.cpp +++ b/client.cpp @@ -72,7 +72,7 @@ Client::Client(const ClientProto &serialized, const vectorpacing_rate, sizeof(stream->pacing_rate)) == -1) { diff --git a/httpinput.cpp b/httpinput.cpp index 75cf99b..b2b6207 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -81,7 +81,7 @@ HTTPInput::HTTPInput(const InputProto &serialized) // Set back the close-on-exec flag for the socket. // (This can't leak into a child, since we haven't been started yet.) if (sock != -1) { - fcntl(sock, F_SETFD, O_CLOEXEC); + fcntl(sock, F_SETFD, FD_CLOEXEC); } pending_data.resize(serialized.pending_data().size()); diff --git a/stream.cpp b/stream.cpp index 4e5ca24..c79391a 100644 --- a/stream.cpp +++ b/stream.cpp @@ -69,7 +69,7 @@ Stream::Stream(const StreamProto &serialized, int data_fd) } // Set the close-on-exec parameter back on the backlog fd. - fcntl(data_fd, F_SETFD, O_CLOEXEC); + fcntl(data_fd, F_SETFD, FD_CLOEXEC); for (ssize_t point : serialized.suitable_starting_point()) { if (point == -1) { diff --git a/udpinput.cpp b/udpinput.cpp index 873b0b9..824c3bc 100644 --- a/udpinput.cpp +++ b/udpinput.cpp @@ -123,7 +123,7 @@ UDPInput::UDPInput(const InputProto &serialized) { // Set back the close-on-exec flag for the socket. // (This can't leak into a child, since we haven't been started yet.) - fcntl(sock, F_SETFD, O_CLOEXEC); + fcntl(sock, F_SETFD, FD_CLOEXEC); // Should be verified by the caller. string protocol;