diff options
author | Colin Watson <cjwatson@debian.org> | 2016-08-06 10:49:58 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2016-08-06 10:49:58 +0100 |
commit | a8ed8d256b2e2c05b0c15565a7938028c5192277 (patch) | |
tree | 87abbdc914a38b43e4e5bb9581ad1f46eabbf88e /regress/modpipe.c | |
parent | f0329aac23c61e1a5197d6d57349a63f459bccb0 (diff) | |
parent | 99522ba7ec6963a05c04a156bf20e3ba3605987c (diff) |
Import openssh_7.3p1.orig.tar.gz
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 | { |