From ddde8e2f32b5c6785e9ac7c6ea6eb84813cca293 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 22 Feb 2007 18:15:29 +0000 Subject: [PATCH] * Handle EINTR in select(). --- src/nix-worker/nix-worker.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc index 6e4c6e4a9..b91e4867c 100644 --- a/src/nix-worker/nix-worker.cc +++ b/src/nix-worker/nix-worker.cc @@ -69,9 +69,9 @@ static bool isFarSideClosed(int socket) fd_set fds; FD_ZERO(&fds); FD_SET(socket, &fds); - - if (select(socket + 1, &fds, 0, 0, &timeout) == -1) - throw SysError("select()"); + + while (select(socket + 1, &fds, 0, 0, &timeout) == -1) + if (errno != EINTR) throw SysError("select()"); if (!FD_ISSET(socket, &fds)) return false;