From 2e4669d6e7053b0347b265d4f330e8873525bd3e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 1 Apr 2011 15:27:46 +0100 Subject: [PATCH] daemon: When running commands, restart select if we receive a signal. (cherry picked from commit 6e5f64089631622167e60df25ee009ef83df5170) --- daemon/guestfsd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 977f170..e18ab31 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -783,9 +783,13 @@ commandrvf (char **stdoutput, char **stderror, int flags, quit = 0; while (quit < 2) { + again: rset2 = rset; r = select (MAX (so_fd[0], se_fd[0]) + 1, &rset2, NULL, NULL, NULL); if (r == -1) { + if (errno == EINTR) + goto again; + perror ("select"); quit: if (stdoutput) free (*stdoutput); -- 1.8.3.1