commit 39c6735348abe23ea4a3c972d518bf8690c0c0b7f9e52c72583c006e8b74118c from: Stefan Sperling date: Tue Sep 23 15:54:45 2025 UTC make the sockets used for gotwebd IPC use non-blocking I/O as intended Hopefully fixes a deadlock I observed where the sockets and fcgi processes were stuck in sendmsg(2) trying to send messages to each other. commit - a59dd8b3fd81898435ce0b1c4d67b4dc6b4392fcaca8a2c9c950bd36c4d6987b commit + 39c6735348abe23ea4a3c972d518bf8690c0c0b7f9e52c72583c006e8b74118c blob - d06c4527a939da0210fd550882db8a955470438a7db137eec20818fbf8e9b783 blob + 0390647562d861de90ad63a6dc02f99905cf8909a0cc1645ce3334770257f61f --- gotwebd/gotwebd.c +++ gotwebd/gotwebd.c @@ -455,7 +455,8 @@ spawn_process(struct gotwebd *env, const char *argv0, int p[2]; pid_t pid; - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, p) == -1) + if (socketpair(AF_UNIX, + SOCK_STREAM | SOCK_CLOEXEC| SOCK_NONBLOCK, PF_UNSPEC, p) == -1) fatal("socketpair"); switch (pid = fork()) { @@ -829,7 +830,8 @@ connect_children(struct gotwebd *env) int pipe[2]; int i; - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe) == -1) + if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, + PF_UNSPEC, pipe) == -1) fatal("socketpair"); if (main_compose_sockets(env, GOTWEBD_IMSG_CTL_PIPE, pipe[0], NULL, 0)) @@ -842,7 +844,9 @@ connect_children(struct gotwebd *env) iev_gotweb = &env->iev_gotweb[i]; iev_auth = &env->iev_auth[i]; - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe) == -1) + if (socketpair(AF_UNIX, + SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, + PF_UNSPEC, pipe) == -1) fatal("socketpair"); if (main_compose_sockets(env, GOTWEBD_IMSG_CTL_PIPE, @@ -853,7 +857,9 @@ connect_children(struct gotwebd *env) pipe[1], NULL, 0)) fatal("send_imsg"); - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe) == -1) + if (socketpair(AF_UNIX, + SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, + PF_UNSPEC, pipe) == -1) fatal("socketpair"); if (send_imsg(iev_auth, GOTWEBD_IMSG_CTL_PIPE,