forked from mirrors/tftp-hpa-google
Portability improvements.
This commit is contained in:
parent
8c3d63fba8
commit
68c0102aa6
6 changed files with 35 additions and 21 deletions
|
@ -8,17 +8,19 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void (*bsd_signal(int signum, void (*handler)(int)))(int);
|
||||
void (*bsd_signal(int, void (*)(int)))(int);
|
||||
|
||||
void (*bsd_signal(int signum, void (*handler)(int)))(int)
|
||||
{
|
||||
struct sigaction action, oldaction;
|
||||
|
||||
memset(&action, 0, sizeof action);
|
||||
action.sa_handler = handler;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaddset(&act.sa_mask, signum);
|
||||
sigaddset(&action.sa_mask, signum);
|
||||
action.sa_flags = SA_RESTART;
|
||||
|
||||
if (sigaction(hander, action, &oldaction) == -1) {
|
||||
if (sigaction(signum, &action, &oldaction) == -1) {
|
||||
#ifdef SIG_ERR
|
||||
return SIG_ERR;
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue