Skip to content
Snippets Groups Projects
Commit ca763b71 authored by Sebastien Ponce's avatar Sebastien Ponce Committed by Steven Murray
Browse files

Fixed usage of sigaction. Previous way did not work for MAC

parent 743545b3
Branches
Tags
No related merge requests found
......@@ -38,9 +38,9 @@ int Cinitdaemon(char *name,
for (c = 3; c < maxfds; c++)
close (c);
if ( wait4child != NULL ) {
memset(&sa, 0, sizeof(sa));
sa.sa_handler = wait4child;
sa.sa_flags = SA_RESTART;
sa.sa_restorer = NULL;
sigaction (SIGCHLD, &sa, NULL);
}
return (maxfds);
......
......@@ -301,10 +301,9 @@ Sigfunc *_netsignal(int signo,
struct sigaction act, oact;
int n = 0;
memset(&act, 0, sizeof(act));
act.sa_handler = func;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
act.sa_restorer = NULL;
if (signo == SIGALRM) {
#ifdef SA_INTERRUPT
act.sa_flags |= SA_INTERRUPT; /* SunOS 4.x */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment