summaryrefslogtreecommitdiffstats
path: root/usr.sbin/relayctl
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-09-01 08:51:34 +0000
committerclaudio <claudio@openbsd.org>2009-09-01 08:51:34 +0000
commit98ad2da2bad3e00f56f8de5d0e50707c889b17b1 (patch)
treeca2a6865b26105c480e3b44fb056e0ba5fec5e74 /usr.sbin/relayctl
parentEcho back the Relay Agent Information option if present (RFC 3046). (diff)
downloadwireguard-openbsd-98ad2da2bad3e00f56f8de5d0e50707c889b17b1.tar.xz
wireguard-openbsd-98ad2da2bad3e00f56f8de5d0e50707c889b17b1.zip
If relayd returned an error don't exit with success. This may help scripts
to recognize when something did not work in a much easier way then parsing the relayctl output. OK reyk@
Diffstat (limited to 'usr.sbin/relayctl')
-rw-r--r--usr.sbin/relayctl/relayctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c
index 81eae4e7bf9..ceb4db920ac 100644
--- a/usr.sbin/relayctl/relayctl.c
+++ b/usr.sbin/relayctl/relayctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayctl.c,v 1.39 2009/08/17 11:36:01 reyk Exp $ */
+/* $OpenBSD: relayctl.c,v 1.40 2009/09/01 08:51:34 claudio Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -83,6 +83,7 @@ struct imsgname imsgunknown = {
};
struct imsgbuf *ibuf;
+int error = 0;
__dead void
usage(void)
@@ -234,7 +235,7 @@ main(int argc, char *argv[])
close(ctl_sock);
free(ibuf);
- return (0);
+ return (error ? 1 : 0);
}
struct imsgname *
@@ -450,6 +451,7 @@ show_command_output(struct imsg *imsg)
break;
case IMSG_CTL_FAIL:
printf("command failed\n");
+ error++;
break;
default:
errx(1, "wrong message in summary: %u", imsg->hdr.type);