summaryrefslogtreecommitdiff
path: root/regress/modpipe.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-02-19 13:15:01 +1100
committerDamien Miller <djm@mindrot.org>2013-02-19 13:15:01 +1100
commitb3764e12024e70296d35877a3da2c4d575dafdb9 (patch)
tree0f320fe0a61795de87d15269f99b09318e257f20 /regress/modpipe.c
parent0dc3bc908e702cc2db460446f11628654c9c602e (diff)
- djm@cvs.openbsd.org 2013/02/19 02:14:09
[integrity.sh] oops, forgot to increase the output of the ssh command to ensure that we actually reach $offset
Diffstat (limited to 'regress/modpipe.c')
-rwxr-xr-xregress/modpipe.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/regress/modpipe.c b/regress/modpipe.c
index 439be4c9d..b05915b63 100755
--- a/regress/modpipe.c
+++ b/regress/modpipe.c
@@ -14,16 +14,44 @@
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16 16
17/* $Id: modpipe.c,v 1.1 2012/12/11 23:54:40 djm Exp $ */ 17/* $Id: modpipe.c,v 1.2 2013/02/19 02:15:08 djm Exp $ */
18 18
19#include <sys/types.h> 19#include <sys/types.h>
20#include <unistd.h> 20#include <unistd.h>
21#include <stdio.h> 21#include <stdio.h>
22#include <string.h> 22#include <string.h>
23#include <stdarg.h>
23#include <stdlib.h> 24#include <stdlib.h>
24#include <err.h>
25#include <errno.h> 25#include <errno.h>
26 26
27static void err(int, const char *, ...) __attribute__((format(printf, 2, 3)));
28static void errx(int, const char *, ...) __attribute__((format(printf, 2, 3)));
29
30static void
31err(int r, const char *fmt, ...)
32{
33 va_list args;
34
35 va_start(args, fmt);
36 fprintf(stderr, "%s: ", strerror(errno));
37 vfprintf(stderr, fmt, args);
38 fputc('\n', stderr);
39 va_end(args);
40 exit(r);
41}
42
43static void
44errx(int r, const char *fmt, ...)
45{
46 va_list args;
47
48 va_start(args, fmt);
49 vfprintf(stderr, fmt, args);
50 fputc('\n', stderr);
51 va_end(args);
52 exit(r);
53}
54
27static void 55static void
28usage(void) 56usage(void)
29{ 57{