mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 04:01:26 +00:00
iscsi-scstd: replace signal() with sigaction()
Replace signal() with sigaction() for validity in a multithreaded process Signed-off-by: David Butterfield <dab21774@gmail.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7139 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -846,8 +846,13 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
* Otherwise we could die in some later write() during the event_loop()
|
||||
* instead of getting EPIPE!
|
||||
*
|
||||
* The effects of signal(2) in a multithreaded process are unspecified,
|
||||
* so use sigaction(2) instead.
|
||||
*/
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
struct sigaction act = (struct sigaction) { .sa_handler = SIG_IGN };
|
||||
int rc = sigaction(SIGPIPE, &act, NULL);
|
||||
assert(rc == 0);
|
||||
|
||||
while ((ch = getopt_long(argc, argv, "c:fd:s:u:g:a:p:vh", long_options, &longindex)) >= 0) {
|
||||
switch (ch) {
|
||||
|
||||
Reference in New Issue
Block a user