[Libguestfs] [PATCH 2/4] daemon: When running commands, restart select if we receive a signal.

Richard W.M. Jones rjones at redhat.com
Fri Apr 1 15:08:39 UTC 2011


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
-------------- next part --------------
>From 6e5f64089631622167e60df25ee009ef83df5170 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Fri, 1 Apr 2011 15:27:46 +0100
Subject: [PATCH 2/4] daemon: When running commands, restart select if we receive a signal.

---
 daemon/guestfsd.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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);
-- 
1.7.4.1



More information about the Libguestfs mailing list