Skip to content

Commit

Permalink
ignore SIGPIPE in qemu-img and qemu-io
Browse files Browse the repository at this point in the history
This prevents the tools from being stopped when they write data to a
closed connection in the other side.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
kazum authored and kevmw committed Aug 6, 2013
1 parent fc11eb2 commit 526eda1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qemu-img.c
Expand Up @@ -2322,6 +2322,10 @@ int main(int argc, char **argv)
const img_cmd_t *cmd;
const char *cmdname;

#ifdef CONFIG_POSIX
signal(SIGPIPE, SIG_IGN);
#endif

error_set_progname(argv[0]);

qemu_init_main_loop();
Expand Down
4 changes: 4 additions & 0 deletions qemu-io.c
Expand Up @@ -335,6 +335,10 @@ int main(int argc, char **argv)
int opt_index = 0;
int flags = BDRV_O_UNMAP;

#ifdef CONFIG_POSIX
signal(SIGPIPE, SIG_IGN);
#endif

progname = basename(argv[0]);

while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) {
Expand Down

0 comments on commit 526eda1

Please sign in to comment.