From 3cc2ff77da2e614e581d9698fb8746d0cd84c8a5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Jun 2023 11:19:14 +0200 Subject: [PATCH] GC server: Clear O_NONBLOCK on the right file descriptor The bug fix in 6d30f9e6fea7d451033653f8f167aef58f7f5347 erroneously cleared O_NONBLOCK on the server rather than client FD (leaving both in an incorrect state). Fixes #8551. (cherry picked from commit a6a75ecad8c1a8bf264eb003b8c07c0fd66f80fb) --- src/libstore/gc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 996f26a95..00ecba6a1 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -564,7 +564,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) /* On macOS, accepted sockets inherit the non-blocking flag from the server socket, so explicitly make it blocking. */ - if (fcntl(fdServer.get(), F_SETFL, fcntl(fdServer.get(), F_GETFL) & ~O_NONBLOCK) == -1) + if (fcntl(fdClient.get(), F_SETFL, fcntl(fdClient.get(), F_GETFL) & ~O_NONBLOCK) == -1) abort(); while (true) {