commit 18441876c29142bdeb5910e372da1200c1b7bc20 from: Stefan Sperling date: Mon Sep 18 08:54:36 2023 UTC make gotsh handle poll timeouts when checking for gotd closing the pack pipe This will hopefully fix issues seen on servers where gotsh exits early for no good reason. commit - ef6234452a17eb17687612d9bd417ded3bf6802d commit + 18441876c29142bdeb5910e372da1200c1b7bc20 blob - 7dd5a1417fcdb549a4424a71d36c5b74480ac8bb blob + 4b4b5a6eb83db18b356def90dad243397510f7d5 --- lib/serve.c +++ lib/serve.c @@ -1105,10 +1105,12 @@ recv_packfile(struct imsg *imsg, int infd) /* Detect gotd(8) closing the pack pipe when done. */ err = got_poll_fd(packfd, 0, 1); if (err) { - if (err->code != GOT_ERR_EOF) + if (err->code != GOT_ERR_TIMEOUT && + err->code != GOT_ERR_EOF) break; + if (err->code == GOT_ERR_EOF) + pack_done = 1; err = NULL; - pack_done = 1; } } else { /* Write pack data and/or detect pipe being closed. */