git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d6b6a3
)
Fix for 'broken pipe' error when qemu dies (RHBZ#508713).
author
Richard W.M. Jones
<rjones@redhat.com>
Mon, 29 Jun 2009 15:22:10 +0000
(16:22 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Mon, 29 Jun 2009 15:22:10 +0000
(16:22 +0100)
src/guestfs.c
patch
|
blob
|
history
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
fdf5cd3
..
016d803
100644
(file)
--- 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;
}