]> xenbits.xensource.com Git - xen.git/commit
tools/libxs: Stop playing with SIGPIPE
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 25 Nov 2024 11:11:04 +0000 (12:11 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Nov 2024 11:11:04 +0000 (12:11 +0100)
commitb6aa39f210d42168633a07f1c18f5d65f041ca09
treecbcb9542ac5ba0c27880ba609a95c5ec45ea5e8d
parent28934a0748cde77b1d2367563de0dba1b5fdb7ce
tools/libxs: Stop playing with SIGPIPE

It's very rude for a library to play with signals behind the back of the
application, no matter ones views on the default behaviour of SIGPIPE under
POSIX.  Even if the application doesn't care about the xenstored socket, it my
care about others.

This logic has existed since xenstore/xenstored was originally added in commit
29c9e570b1ed ("Add xenstore daemon and library") in 2005.

It's also unnecessary.  Pass MSG_NOSIGNAL when talking to xenstored over a
pipe (to avoid sucumbing to SIGPIPE if xenstored has crashed), and forgo any
playing with the signal disposition.

This has a side benefit of saving 2 syscalls per xenstore request.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
master commit: a17b6db9b00784b409c35e3017dc45aed1ec2bfb
master date: 2024-07-23 15:11:27 +0100
tools/libs/store/xs.c