Fix sandman hang

It was hanging after sending SIGTSTP to its child, then receiving a
SIGCHLD to indicate the child had stopped.
master
Curtis McEnroe 2018-12-01 21:55:32 -05:00
parent e708b795b5
commit e3cff14e03
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ int main(int argc, char *argv[]) {
struct sigaction sa = { struct sigaction sa = {
.sa_handler = handler, .sa_handler = handler,
.sa_mask = mask, .sa_mask = mask,
.sa_flags = SA_RESTART, .sa_flags = SA_NOCLDSTOP | SA_RESTART,
}; };
sigaction(SIGCHLD, &sa, NULL); sigaction(SIGCHLD, &sa, NULL);
@ -56,7 +56,7 @@ int main(int argc, char *argv[]) {
[[NSWorkspace sharedWorkspace] notificationCenter] [[NSWorkspace sharedWorkspace] notificationCenter]
addObserverForName: NSWorkspaceWillSleepNotification addObserverForName: NSWorkspaceWillSleepNotification
object: nil object: nil
queue: [NSOperationQueue mainQueue] queue: nil
usingBlock: ^(NSNotification *note) { usingBlock: ^(NSNotification *note) {
(void)note; (void)note;
int error = kill(pid, SIGTSTP); int error = kill(pid, SIGTSTP);
@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
[[NSWorkspace sharedWorkspace] notificationCenter] [[NSWorkspace sharedWorkspace] notificationCenter]
addObserverForName: NSWorkspaceDidWakeNotification addObserverForName: NSWorkspaceDidWakeNotification
object: nil object: nil
queue: [NSOperationQueue mainQueue] queue: nil
usingBlock: ^(NSNotification *note) { usingBlock: ^(NSNotification *note) {
(void)note; (void)note;
int error = kill(pid, SIGCONT); int error = kill(pid, SIGCONT);