From 526eda14a68d5b3596be715505289b541288ef2a Mon Sep 17 00:00:00 2001 From: MORITA Kazutaka Date: Tue, 23 Jul 2013 17:30:11 +0900 Subject: 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: MORITA Kazutaka Reviewed-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- qemu-io.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qemu-io.c') diff --git a/qemu-io.c b/qemu-io.c index cb9def50e6..d54dc86921 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -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) { -- cgit v1.2.1