anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

sigaction.cpp (606B)

      1 /* POSIX emulation layer for Windows.
      2  *
      3  * (C) 2008-2022 Anope Team
      4  * Contact us at team@anope.org
      5  *
      6  * Please read COPYING and README for further details.
      7  *
      8  * Based on the original code of Epona by Lara.
      9  * Based on the original code of Services by Andy Church.
     10  */
     11 
     12 #include <windows.h>
     13 #include "sigaction.h"
     14 #include <signal.h>
     15 
     16 int sigaction(int sig, struct sigaction *action, struct sigaction *old)
     17 {
     18 	if (sig == -1)
     19 		return 0;
     20 	if (old == NULL)
     21 	{
     22 		if (signal(sig, SIG_DFL) == SIG_ERR)
     23 			return -1;
     24 	}
     25 	else
     26 	{
     27 		if (signal(sig, action->sa_handler) == SIG_ERR)
     28 			return -1;
     29 	}
     30 	return 0;
     31 }