diff options
| author | van Hauser <vh@thc.org> | 2020-04-12 12:13:01 +0200 |
|---|---|---|
| committer | van Hauser <vh@thc.org> | 2020-04-12 12:13:01 +0200 |
| commit | 0a525f768b8b50e6f20a59489f19a4efe84ccfff (patch) | |
| tree | e04aa443ac4fefc6acad438e8d778f57ecdfc109 /test/test-unsigaction.c | |
| parent | 4ed43b7632e8e0d80230bd3c27ee7f4d536a543a (diff) | |
| download | afl++-0a525f768b8b50e6f20a59489f19a4efe84ccfff.tar.gz | |
local/global var for compare-transform-pass and code-format
Diffstat (limited to 'test/test-unsigaction.c')
| -rw-r--r-- | test/test-unsigaction.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/test/test-unsigaction.c b/test/test-unsigaction.c index 1a5e4b26..8c6c7f41 100644 --- a/test/test-unsigaction.c +++ b/test/test-unsigaction.c @@ -1,25 +1,31 @@ -#include <signal.h> /* sigemptyset(), sigaction(), kill(), SIGUSR1 */ -#include <stdlib.h> /* exit() */ -#include <unistd.h> /* getpid() */ -#include <errno.h> /* errno */ -#include <stdio.h> /* fprintf() */ - -static void mysig_handler(int sig) -{ - exit(2); +#include <signal.h> /* sigemptyset(), sigaction(), kill(), SIGUSR1 */ +#include <stdlib.h> /* exit() */ +#include <unistd.h> /* getpid() */ +#include <errno.h> /* errno */ +#include <stdio.h> /* fprintf() */ + +static void mysig_handler(int sig) { + + exit(2); + } -int main() -{ - /* setup sig handler */ - struct sigaction sa; - sa.sa_handler = mysig_handler; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - if (sigaction(SIGCHLD, &sa, NULL)) { - fprintf(stderr, "could not set signal handler %d, aborted\n", errno); - exit(1); - } - kill(getpid(), SIGCHLD); - return 0; +int main() { + + /* setup sig handler */ + struct sigaction sa; + sa.sa_handler = mysig_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + if (sigaction(SIGCHLD, &sa, NULL)) { + + fprintf(stderr, "could not set signal handler %d, aborted\n", errno); + exit(1); + + } + + kill(getpid(), SIGCHLD); + return 0; + } + |
