summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2009-06-29 16:27:05 +0100
committerMatthew Booth <mbooth@redhat.com>2009-06-29 16:27:05 +0100
commit128f822e16bb96677c75b88125e18f48d7ccedaf (patch)
treec5f09d72e73c90c02967f48151831e6c4a78fb68 /src/guestfs.c
parent103fb55e6b1428366ab31a0f17484ef1baa68e96 (diff)
parentad475104ec7fae456d3309cbf4261b893ed160bb (diff)
downloadlibguestfs-128f822e16bb96677c75b88125e18f48d7ccedaf.tar.gz
libguestfs-128f822e16bb96677c75b88125e18f48d7ccedaf.tar.xz
libguestfs-128f822e16bb96677c75b88125e18f48d7ccedaf.zip
Merge commit 'et/master'
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index fdf5cd36..016d8035 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -1677,7 +1677,7 @@ static void
sock_write_event (struct guestfs_main_loop *ml, guestfs_h *g, void *data,
int watch, int fd, int events)
{
- int n;
+ int n, err;
if (g->verbose)
fprintf (stderr,
@@ -1701,8 +1701,11 @@ sock_write_event (struct guestfs_main_loop *ml, guestfs_h *g, void *data,
n = write (g->sock, g->msg_out + g->msg_out_pos,
g->msg_out_size - g->msg_out_pos);
if (n == -1) {
- if (errno != EAGAIN)
+ err = errno;
+ if (err != EAGAIN)
perrorf (g, "write");
+ if (err == EPIPE) /* Disconnected from guest (RHBZ#508713). */
+ child_cleanup (g);
return;
}