diff options
author | guenther <> | 2015-10-25 04:11:00 +0000 |
---|---|---|
committer | guenther <> | 2015-10-25 04:11:00 +0000 |
commit | bf8064e5addf51d4c3571881db1e37bffdab9267 (patch) | |
tree | 13b72961c5c5fb28f49442c1df7fd1a1bd6e20c7 /src | |
parent | 767667654245299fbb1dbd106aeaf7a445fe829b (diff) | |
download | openbsd-bf8064e5addf51d4c3571881db1e37bffdab9267.tar.gz openbsd-bf8064e5addf51d4c3571881db1e37bffdab9267.tar.bz2 openbsd-bf8064e5addf51d4c3571881db1e37bffdab9267.zip |
Use dprintf() instead of fprintf() in the signal handler
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libc/atexit/atexit_test.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/regress/lib/libc/atexit/atexit_test.c b/src/regress/lib/libc/atexit/atexit_test.c index f374dee9eb..e1ea82f827 100644 --- a/src/regress/lib/libc/atexit/atexit_test.c +++ b/src/regress/lib/libc/atexit/atexit_test.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: atexit_test.c,v 1.7 2014/06/18 19:01:10 kettenis Exp $ */ | 1 | /* $OpenBSD: atexit_test.c,v 1.8 2015/10/25 04:11:00 guenther Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2002 Daniel Hartmeier | 4 | * Copyright (c) 2002 Daniel Hartmeier |
@@ -38,6 +38,7 @@ | |||
38 | #include <stdlib.h> | 38 | #include <stdlib.h> |
39 | #include <string.h> | 39 | #include <string.h> |
40 | #include <signal.h> | 40 | #include <signal.h> |
41 | #include <unistd.h> | ||
41 | #include "stdlib/atexit.h" | 42 | #include "stdlib/atexit.h" |
42 | 43 | ||
43 | void handle_first(void); | 44 | void handle_first(void); |
@@ -131,10 +132,10 @@ handle_signal(int sigraised) | |||
131 | { | 132 | { |
132 | switch (sigraised) { | 133 | switch (sigraised) { |
133 | case SIGSEGV: | 134 | case SIGSEGV: |
134 | fprintf(stderr, "SIGSEGV\n"); | 135 | dprintf(STDERR_FILENO, "SIGSEGV\n"); |
135 | exit(0); | 136 | exit(0); |
136 | default: | 137 | default: |
137 | fprintf(stderr, "unexpected signal caught\n"); | 138 | dprintf(STDERR_FILENO, "unexpected signal caught\n"); |
138 | exit(1); | 139 | exit(1); |
139 | } | 140 | } |
140 | } | 141 | } |