From: Richard W.M. Jones Date: Fri, 1 Apr 2011 14:27:46 +0000 (+0100) Subject: daemon: When running commands, restart select if we receive a signal. X-Git-Tag: 1.9.16~5 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6e5f64089631622167e60df25ee009ef83df5170;p=libguestfs.git daemon: When running commands, restart select if we receive a signal. --- diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 3632889..1c695eb 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -768,9 +768,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);