]> git.sesse.net Git - cubemap/commitdiff
Fix yet more stupid close-on-exec bugs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 2 Apr 2023 20:25:09 +0000 (22:25 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 2 Apr 2023 20:25:09 +0000 (22:25 +0200)
acceptor.cpp
client.cpp
httpinput.cpp
stream.cpp
udpinput.cpp

index 31901dd8406c97c39d97dc9b3310dedb4f37a18e..75dd70b5540ff291b1cb2f7f54000a1340ae9ef4 100644 (file)
@@ -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
index 5d5c179be0e6df019930fb2924cf22be2e7bcab1..fb278e2803d73e57f1a20a683c9dab663c7c9e88 100644 (file)
@@ -72,7 +72,7 @@ Client::Client(const ClientProto &serialized, const vector<shared_ptr<const stri
 {
        // 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);
 
        if (stream != nullptr) {
                if (setsockopt(sock, SOL_SOCKET, SO_MAX_PACING_RATE, &stream->pacing_rate, sizeof(stream->pacing_rate)) == -1) {
index 75cf99b9c8de73983e039bd2061dd7ef2da20c96..b2b620706ad368983e37aafd8ae1e1f101e784f6 100644 (file)
@@ -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());
index 4e5ca24cceab8870dfdfa00e66b161aecc61f729..c79391a81990b2f94ddef1b460beb08b62de0274 100644 (file)
@@ -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) {
index 873b0b952911a226d8f08255f80e2d092e163801..824c3bcf856146d23adb4dbf80b13f89325bb2cb 100644 (file)
@@ -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;