aboutsummaryrefslogtreecommitdiff
path: root/qga/main.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2015-10-13 18:41:21 +0300
committerMichael Roth <mdroth@linux.vnet.ibm.com>2015-10-19 18:31:54 -0500
commit4005b4732e40d3d583510db89ee204b834022d20 (patch)
tree65ae3ded96b16a1afb4390c94d23a8815900d540 /qga/main.c
parentd697e30cfff29a6a72e3197a218294ba52e7f0c6 (diff)
downloadqemu-4005b4732e40d3d583510db89ee204b834022d20.zip
qemu-4005b4732e40d3d583510db89ee204b834022d20.tar.gz
qemu-4005b4732e40d3d583510db89ee204b834022d20.tar.bz2
qga: handle possible SIGPIPE in guest-file-write
qemu-ga should not exit on guest-file-write to pipe without read end but proper error code should be returned. The behavior of the spawned process should be default thus SIGPIPE processing should be reset to default after fork() but before exec(). Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Yuri Pudgorodskiy <yur@virtuozzo.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/main.c')
-rw-r--r--qga/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/qga/main.c b/qga/main.c
index aa6a063..068169f 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -161,6 +161,12 @@ static gboolean register_signal_handlers(void)
g_error("error configuring signal handler: %s", strerror(errno));
}
+ sigact.sa_handler = SIG_IGN;
+ if (sigaction(SIGPIPE, &sigact, NULL) != 0) {
+ g_error("error configuring SIGPIPE signal handler: %s",
+ strerror(errno));
+ }
+
return true;
}