diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-09-01 08:51:35 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-09-01 08:51:35 +0000 |
commit | 3d9dba9640bacb2e0f107ca14afee010aa0ff6e3 (patch) | |
tree | 5da4749898623d9e066f3d41068c4062e76b4336 /usr.sbin/relayctl/relayctl.c | |
parent | 8ab63b16084c59dddb1a8207a5a629f51a1459d3 (diff) |
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/relayctl.c')
-rw-r--r-- | usr.sbin/relayctl/relayctl.c | 6 |
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); |