summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmctl
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2019-08-23 07:55:20 +0000
committermlarkin <mlarkin@openbsd.org>2019-08-23 07:55:20 +0000
commitf460dd9fe068d238e47877a9e105e1f80374ee9b (patch)
treead9342c860756db666c612b366361a990c0c8397 /usr.sbin/vmctl
parentres_hnok() is too lenient wrt to acceptable domain name in mail addresses. (diff)
downloadwireguard-openbsd-f460dd9fe068d238e47877a9e105e1f80374ee9b.tar.xz
wireguard-openbsd-f460dd9fe068d238e47877a9e105e1f80374ee9b.zip
vmctl(8): fix wrong output when using 'vmctl stop'
Fix a wrong output when using 'vmctl stop' without any further arguments. Patch from Caspar Schutijser, thanks! ok deraadt
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r--usr.sbin/vmctl/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c
index 02086d08611..3eb89c9fe96 100644
--- a/usr.sbin/vmctl/main.c
+++ b/usr.sbin/vmctl/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.57 2019/07/05 22:22:40 jmc Exp $ */
+/* $OpenBSD: main.c,v 1.58 2019/08/23 07:55:20 mlarkin Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -945,7 +945,10 @@ ctl_stop(struct parse_result *res, int argc, char *argv[])
argc -= optind;
argv += optind;
- if (argc > 1)
+ if (argc == 0) {
+ if (res->action != CMD_STOPALL)
+ ctl_usage(res->ctl);
+ } else if (argc > 1)
ctl_usage(res->ctl);
else if (argc == 1)
ret = parse_vmid(res, argv[0], 0);