python: Rearrange C files for bindings.
[libguestfs.git] / daemon / guestfsd.c
index 1af0f7a..ac8750c 100644 (file)
@@ -679,6 +679,8 @@ commandrvf (char **stdoutput, char **stderror, int flags,
   }
 
   if (pid == 0) {              /* Child process running the command. */
+    signal (SIGALRM, SIG_DFL);
+    signal (SIGPIPE, SIG_DFL);
     close (0);
     if (flag_copy_stdin) {
       dup2 (stdin_fd[0], 0);
@@ -767,9 +769,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);