diff options
author | Denis V. Lunev <den@openvz.org> | 2015-10-13 18:41:21 +0300 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2015-10-19 18:31:54 -0500 |
commit | 4005b4732e40d3d583510db89ee204b834022d20 (patch) | |
tree | 65ae3ded96b16a1afb4390c94d23a8815900d540 /qga/main.c | |
parent | d697e30cfff29a6a72e3197a218294ba52e7f0c6 (diff) |
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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/qga/main.c b/qga/main.c index aa6a063446..068169fcbc 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; } |