diff options
Diffstat (limited to 'regress/modpipe.c')
-rwxr-xr-x | regress/modpipe.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/regress/modpipe.c b/regress/modpipe.c index e854f9e07..5f4824b51 100755 --- a/regress/modpipe.c +++ b/regress/modpipe.c | |||
@@ -25,36 +25,11 @@ | |||
25 | #include <stdarg.h> | 25 | #include <stdarg.h> |
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #ifdef HAVE_ERR_H | ||
29 | # include <err.h> | ||
30 | #endif | ||
28 | #include "openbsd-compat/getopt_long.c" | 31 | #include "openbsd-compat/getopt_long.c" |
29 | 32 | ||
30 | static void err(int, const char *, ...) __attribute__((format(printf, 2, 3))); | ||
31 | static void errx(int, const char *, ...) __attribute__((format(printf, 2, 3))); | ||
32 | |||
33 | static void | ||
34 | err(int r, const char *fmt, ...) | ||
35 | { | ||
36 | va_list args; | ||
37 | |||
38 | va_start(args, fmt); | ||
39 | fprintf(stderr, "%s: ", strerror(errno)); | ||
40 | vfprintf(stderr, fmt, args); | ||
41 | fputc('\n', stderr); | ||
42 | va_end(args); | ||
43 | exit(r); | ||
44 | } | ||
45 | |||
46 | static void | ||
47 | errx(int r, const char *fmt, ...) | ||
48 | { | ||
49 | va_list args; | ||
50 | |||
51 | va_start(args, fmt); | ||
52 | vfprintf(stderr, fmt, args); | ||
53 | fputc('\n', stderr); | ||
54 | va_end(args); | ||
55 | exit(r); | ||
56 | } | ||
57 | |||
58 | static void | 33 | static void |
59 | usage(void) | 34 | usage(void) |
60 | { | 35 | { |