diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 7a414da6b..ee123d84e 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -535,6 +535,12 @@ 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) + abort(); + while (true) { try { auto path = readLine(fdClient.get());