commit b6ca2f6f51dc4bb6b35c671129e9985982650915 from: Thomas Adam date: Thu Apr 17 19:34:15 2025 UTC portable: handle SOCK_CLOEXEC portably commit - e7391431b994ccdc312dac62dae0284f220d92d1 commit + b6ca2f6f51dc4bb6b35c671129e9985982650915 blob - a999d2129315ff4dd74778dfd89e78c858a974dd blob + 2708a986c1fa0c9b44d62aaa884b0181b3f81d6c --- gotwebd/fcgi.c +++ gotwebd/fcgi.c @@ -219,8 +219,13 @@ process_request(struct request *c) int ret, i, pipe[2]; struct request ic; struct event *resp_event = NULL; + int sock_flags = SOCK_STREAM | SOCK_NONBLOCK; - if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, +#ifdef SOCK_CLOEXEC + sock_flags |= SOCK_CLOEXEC; +#endif + + if (socketpair(AF_UNIX, sock_flags, PF_UNSPEC, pipe) == -1) { log_warn("socketpair"); return;