/*
- * $Id: server_child.c,v 1.10 2008-12-03 18:35:44 didg Exp $
+ * $Id: server_child.c,v 1.12 2010-01-21 14:14:49 didg Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
* chance to add the child in. */
sigemptyset(&sig);
sigaddset(&sig, SIGCHLD);
- sigprocmask(SIG_BLOCK, &sig, &oldsig);
+ pthread_sigmask(SIG_BLOCK, &sig, &oldsig);
/* it's possible that the child could have already died before the
- * sigprocmask. we need to check for this. */
+ * pthread_sigmask. we need to check for this. */
if (kill(pid, 0) < 0) {
- sigprocmask(SIG_SETMASK, &oldsig, NULL);
+ pthread_sigmask(SIG_SETMASK, &oldsig, NULL);
return 1;
}
/* if we already have an entry. just return. */
if (resolve_child(fork->table, pid)) {
- sigprocmask(SIG_SETMASK, &oldsig, NULL);
+ pthread_sigmask(SIG_SETMASK, &oldsig, NULL);
return 0;
}
if ((child = (struct server_child_data *)
calloc(1, sizeof(struct server_child_data))) == NULL) {
- sigprocmask(SIG_SETMASK, &oldsig, NULL);
+ pthread_sigmask(SIG_SETMASK, &oldsig, NULL);
return -1;
}
child->killed = 0;
hash_child(fork->table, child);
children->count++;
- sigprocmask(SIG_SETMASK, &oldsig, NULL);
+ pthread_sigmask(SIG_SETMASK, &oldsig, NULL);
return 0;
}
child->valid = 1;
child->idlen = idlen;
child->clientid = id;
- LOG(log_info, logtype_default, "Setting clientid (len %d) for %d, boottime %X", idlen, child->pid, boottime);
+ LOG(log_debug, logtype_default, "Setting clientid (len %d) for %d, boottime %X", idlen, child->pid, boottime);
}
child = tmp;
}
sv.sa_handler = SIG_DFL;
sigemptyset( &sv.sa_mask );
- sigaction(SIGALRM, &sv, 0 );
- sigaction(SIGHUP, &sv, 0 );
- sigaction(SIGTERM, &sv, 0 );
- sigaction(SIGUSR1, &sv, 0 );
- sigaction(SIGCHLD, &sv, 0 );
+ sigaction(SIGALRM, &sv, NULL );
+ sigaction(SIGHUP, &sv, NULL );
+ sigaction(SIGTERM, &sv, NULL );
+ sigaction(SIGUSR1, &sv, NULL );
+ sigaction(SIGCHLD, &sv, NULL );
sigemptyset(&sigs);
sigaddset(&sigs, SIGALRM);
sigaddset(&sigs, SIGHUP);
sigaddset(&sigs, SIGUSR1);
sigaddset(&sigs, SIGCHLD);
- sigprocmask(SIG_UNBLOCK, &sigs, NULL);
+ pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
}