diff options
| author | Adam <Adam@anope.org> | 2011-11-08 17:29:16 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-11-08 17:29:16 -0500 |
| commit | b5ff856f47d8e54d12c568462a06351633c29610 (patch) | |
| tree | a4e2f96c59ee49aa5e6cacdfd30db6155151ad36 /src/win32/sigaction | |
| parent | 97b9055f92f21cd91af44a3d5dacce0024536cff (diff) | |
Windows
Diffstat (limited to 'src/win32/sigaction')
| -rw-r--r-- | src/win32/sigaction/sigaction.cpp | 60 | ||||
| -rw-r--r-- | src/win32/sigaction/sigaction.h | 56 |
2 files changed, 58 insertions, 58 deletions
diff --git a/src/win32/sigaction/sigaction.cpp b/src/win32/sigaction/sigaction.cpp index f65ffaa84..e79187461 100644 --- a/src/win32/sigaction/sigaction.cpp +++ b/src/win32/sigaction/sigaction.cpp @@ -1,31 +1,31 @@ - /* POSIX emulation layer for Windows.
- *
- * Copyright (C) 2008-2011 Anope Team <team@anope.org>
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- */
-
- #include <windows.h>
- #include "sigaction.h"
- #include <signal.h>
-
- int sigaction(int sig, struct sigaction *action, struct sigaction *old)
- {
- if (sig == -1)
- return 0;
- if (old == NULL)
- {
- if (signal(sig, SIG_DFL) == SIG_ERR)
- return -1;
- }
- else
- {
- if (signal(sig, action->sa_handler) == SIG_ERR)
- return -1;
- }
- return 0;
- }
+ /* POSIX emulation layer for Windows. + * + * Copyright (C) 2008-2011 Anope Team <team@anope.org> + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + + #include <windows.h> + #include "sigaction.h" + #include <signal.h> + + int sigaction(int sig, struct sigaction *action, struct sigaction *old) + { + if (sig == -1) + return 0; + if (old == NULL) + { + if (signal(sig, SIG_DFL) == SIG_ERR) + return -1; + } + else + { + if (signal(sig, action->sa_handler) == SIG_ERR) + return -1; + } + return 0; + }
\ No newline at end of file diff --git a/src/win32/sigaction/sigaction.h b/src/win32/sigaction/sigaction.h index 366965f8b..96d67e8e9 100644 --- a/src/win32/sigaction/sigaction.h +++ b/src/win32/sigaction/sigaction.h @@ -1,28 +1,28 @@ - /* POSIX emulation layer for Windows.
- *
- * Copyright (C) 2008-2011 Anope Team <team@anope.org>
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- */
-
- #define sigemptyset(x) memset((x), 0, sizeof(*(x)))
-
- #ifndef SIGHUP
- # define SIGHUP -1
- #endif
- #ifndef SIGPIPE
- # define SIGPIPE -1
- #endif
-
- struct sigaction
- {
- void (*sa_handler)(int);
- int sa_flags;
- int sa_mask;
- };
-
- extern int sigaction(int, struct sigaction *, struct sigaction *);
-
+ /* POSIX emulation layer for Windows. + * + * Copyright (C) 2008-2011 Anope Team <team@anope.org> + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + + #define sigemptyset(x) memset((x), 0, sizeof(*(x))) + + #ifndef SIGHUP + # define SIGHUP -1 + #endif + #ifndef SIGPIPE + # define SIGPIPE -1 + #endif + + struct sigaction + { + void (*sa_handler)(int); + int sa_flags; + int sa_mask; + }; + + extern int sigaction(int, struct sigaction *, struct sigaction *); + |
