mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-16 00:16:12 +00:00
DM: handle SIGPIPE signal
Ignore SIGPIPE signal and handle the error directly when write() function fails. this will help us to catch the write failure rather than crashing the UOS. PS: Observed that when acrnctl stop command was issued from kata-runtime, UOS was crashing with SIGPIPE signal. Tracked-On: #3190 Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
19366458f8
commit
a4e28213c2
@ -785,6 +785,13 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "cannot register handler for SIGHUP\n");
|
||||
if (signal(SIGINT, sig_handler_term) == SIG_ERR)
|
||||
fprintf(stderr, "cannot register handler for SIGINT\n");
|
||||
/*
|
||||
* Ignore SIGPIPE signal and handle the error directly when write()
|
||||
* function fails. this will help us to catch the write failure rather
|
||||
* than crashing the UOS.
|
||||
*/
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
|
||||
fprintf(stderr, "cannot register handler for SIGPIPE\n");
|
||||
|
||||
while ((c = getopt_long(argc, argv, optstr, long_options,
|
||||
&option_idx)) != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user