Commit 526eda14 authored by MORITA Kazutaka's avatar MORITA Kazutaka Committed by Kevin Wolf
Browse files

ignore SIGPIPE in qemu-img and qemu-io



This prevents the tools from being stopped when they write data to a
closed connection in the other side.
Signed-off-by: default avatarMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent fc11eb26
...@@ -2322,6 +2322,10 @@ int main(int argc, char **argv) ...@@ -2322,6 +2322,10 @@ int main(int argc, char **argv)
const img_cmd_t *cmd; const img_cmd_t *cmd;
const char *cmdname; const char *cmdname;
#ifdef CONFIG_POSIX
signal(SIGPIPE, SIG_IGN);
#endif
error_set_progname(argv[0]); error_set_progname(argv[0]);
qemu_init_main_loop(); qemu_init_main_loop();
......
...@@ -335,6 +335,10 @@ int main(int argc, char **argv) ...@@ -335,6 +335,10 @@ int main(int argc, char **argv)
int opt_index = 0; int opt_index = 0;
int flags = BDRV_O_UNMAP; int flags = BDRV_O_UNMAP;
#ifdef CONFIG_POSIX
signal(SIGPIPE, SIG_IGN);
#endif
progname = basename(argv[0]); progname = basename(argv[0]);
while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) { while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment