diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/misc/kexfuzz/kexfuzz.c | 4 | ||||
-rw-r--r-- | regress/netcat.c | 40 |
2 files changed, 3 insertions, 41 deletions
diff --git a/regress/misc/kexfuzz/kexfuzz.c b/regress/misc/kexfuzz/kexfuzz.c index e6751d31c..2894d3a1e 100644 --- a/regress/misc/kexfuzz/kexfuzz.c +++ b/regress/misc/kexfuzz/kexfuzz.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <string.h> | 17 | #include <string.h> |
18 | #include <unistd.h> | 18 | #include <unistd.h> |
19 | #include <fcntl.h> | 19 | #include <fcntl.h> |
20 | #include <err.h> | 20 | #ifdef HAVE_ERR_H |
21 | # include <err.h> | ||
22 | #endif | ||
21 | 23 | ||
22 | #include "ssherr.h" | 24 | #include "ssherr.h" |
23 | #include "ssh_api.h" | 25 | #include "ssh_api.h" |
diff --git a/regress/netcat.c b/regress/netcat.c index 6234ba019..7c29e0cf9 100644 --- a/regress/netcat.c +++ b/regress/netcat.c | |||
@@ -134,46 +134,6 @@ void usage(int); | |||
134 | ssize_t drainbuf(int, unsigned char *, size_t *); | 134 | ssize_t drainbuf(int, unsigned char *, size_t *); |
135 | ssize_t fillbuf(int, unsigned char *, size_t *); | 135 | ssize_t fillbuf(int, unsigned char *, size_t *); |
136 | 136 | ||
137 | static void err(int, const char *, ...) __attribute__((format(printf, 2, 3))); | ||
138 | static void errx(int, const char *, ...) __attribute__((format(printf, 2, 3))); | ||
139 | static void warn(const char *, ...) __attribute__((format(printf, 1, 2))); | ||
140 | |||
141 | static void | ||
142 | err(int r, const char *fmt, ...) | ||
143 | { | ||
144 | va_list args; | ||
145 | |||
146 | va_start(args, fmt); | ||
147 | fprintf(stderr, "%s: ", strerror(errno)); | ||
148 | vfprintf(stderr, fmt, args); | ||
149 | fputc('\n', stderr); | ||
150 | va_end(args); | ||
151 | exit(r); | ||
152 | } | ||
153 | |||
154 | static void | ||
155 | errx(int r, const char *fmt, ...) | ||
156 | { | ||
157 | va_list args; | ||
158 | |||
159 | va_start(args, fmt); | ||
160 | vfprintf(stderr, fmt, args); | ||
161 | fputc('\n', stderr); | ||
162 | va_end(args); | ||
163 | exit(r); | ||
164 | } | ||
165 | |||
166 | static void | ||
167 | warn(const char *fmt, ...) | ||
168 | { | ||
169 | va_list args; | ||
170 | |||
171 | va_start(args, fmt); | ||
172 | fprintf(stderr, "%s: ", strerror(errno)); | ||
173 | vfprintf(stderr, fmt, args); | ||
174 | fputc('\n', stderr); | ||
175 | va_end(args); | ||
176 | } | ||
177 | 137 | ||
178 | int | 138 | int |
179 | main(int argc, char *argv[]) | 139 | main(int argc, char *argv[]) |