diff options
author | jasper <jasper@openbsd.org> | 2019-05-22 16:19:21 +0000 |
---|---|---|
committer | jasper <jasper@openbsd.org> | 2019-05-22 16:19:21 +0000 |
commit | 8f40ce4ba47832671d8777a34a299874a63b0910 (patch) | |
tree | 1b37cc1355e5b8d2988e5aa6831f15d2d72838b4 /usr.sbin/vmctl | |
parent | i386/amd64 apm(4): Ignore APM_UPDATE_TIME events. (diff) | |
download | wireguard-openbsd-8f40ce4ba47832671d8777a34a299874a63b0910.tar.xz wireguard-openbsd-8f40ce4ba47832671d8777a34a299874a63b0910.zip |
re-order to reported states based on order of significance:
paused takes priority over running; running takes priority over disabled
ok mlarkin@ pd@
Diffstat (limited to 'usr.sbin/vmctl')
-rw-r--r-- | usr.sbin/vmctl/vmctl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/vmctl/vmctl.c b/usr.sbin/vmctl/vmctl.c index a029875dd6a..60b028b7809 100644 --- a/usr.sbin/vmctl/vmctl.c +++ b/usr.sbin/vmctl/vmctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmctl.c,v 1.68 2019/05/16 06:41:47 jasper Exp $ */ +/* $OpenBSD: vmctl.c,v 1.69 2019/05/22 16:19:21 jasper Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> @@ -715,15 +715,15 @@ add_info(struct imsg *imsg, int *ret) const char * vm_state(unsigned int mask) { - /* Presence of absence of other flags */ - if (!mask || (mask & VM_STATE_DISABLED)) - return "stopped"; - else if (mask & VM_STATE_PAUSED) + if (mask & VM_STATE_PAUSED) return "paused"; - else if (mask & VM_STATE_SHUTDOWN) - return "stopping"; else if (mask & VM_STATE_RUNNING) return "running"; + else if (mask & VM_STATE_SHUTDOWN) + return "stopping"; + /* Presence of absence of other flags */ + else if (!mask || (mask & VM_STATE_DISABLED)) + return "stopped"; return "unknown"; } |