1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-01 09:51:50 -05:00

pacman: set SA_RESTART for signal handler

Calling a signal handler interrupts some functions, most notably read()
and therefore fgets().

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2014-08-06 16:53:16 -04:00 committed by Allan McRae
parent c792262b13
commit 24e0bd215c

View File

@ -1029,7 +1029,7 @@ int main(int argc, char *argv[])
/* Set up the structure to specify the new action. */
new_action.sa_handler = handler;
sigemptyset(&new_action.sa_mask);
new_action.sa_flags = 0;
new_action.sa_flags = SA_RESTART;
/* assign our handler to any signals we care about */
for(i = 0; i < sizeof(signals) / sizeof(signals[0]); i++) {