diff options
author | 2015-10-25 04:11:00 +0000 | |
---|---|---|
committer | 2015-10-25 04:11:00 +0000 | |
commit | 3365188948c22c0cd742dd8abd95d9abc04d644c (patch) | |
tree | 48be9395bf92f721bc1aead2cff29e984b82fec5 /regress/lib/libc | |
parent | POSIX says that you can't capture the return value of sigsetjmp(). (diff) | |
download | wireguard-openbsd-3365188948c22c0cd742dd8abd95d9abc04d644c.tar.xz wireguard-openbsd-3365188948c22c0cd742dd8abd95d9abc04d644c.zip |
Use dprintf() instead of fprintf() in the signal handler
Diffstat (limited to 'regress/lib/libc')
-rw-r--r-- | regress/lib/libc/atexit/atexit_test.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/regress/lib/libc/atexit/atexit_test.c b/regress/lib/libc/atexit/atexit_test.c index f374dee9eb3..e1ea82f827b 100644 --- a/regress/lib/libc/atexit/atexit_test.c +++ b/regress/lib/libc/atexit/atexit_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atexit_test.c,v 1.7 2014/06/18 19:01:10 kettenis Exp $ */ +/* $OpenBSD: atexit_test.c,v 1.8 2015/10/25 04:11:00 guenther Exp $ */ /* * Copyright (c) 2002 Daniel Hartmeier @@ -38,6 +38,7 @@ #include <stdlib.h> #include <string.h> #include <signal.h> +#include <unistd.h> #include "stdlib/atexit.h" void handle_first(void); @@ -131,10 +132,10 @@ handle_signal(int sigraised) { switch (sigraised) { case SIGSEGV: - fprintf(stderr, "SIGSEGV\n"); + dprintf(STDERR_FILENO, "SIGSEGV\n"); exit(0); default: - fprintf(stderr, "unexpected signal caught\n"); + dprintf(STDERR_FILENO, "unexpected signal caught\n"); exit(1); } } |