summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2020-05-17 05:37:49 +0000
committerratchov <ratchov@openbsd.org>2020-05-17 05:37:49 +0000
commitfcb1182c52341cd5544e8d2cacc650295ecaa12f (patch)
treee62706c6937f4c721efd96c7e47ef9e397d5e087
parentWhen -m is used, always print one line per control (diff)
downloadwireguard-openbsd-fcb1182c52341cd5544e8d2cacc650295ecaa12f.tar.xz
wireguard-openbsd-fcb1182c52341cd5544e8d2cacc650295ecaa12f.zip
When -m is used, don't print controls that didn't change
-rw-r--r--usr.bin/sndioctl/sndioctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/sndioctl/sndioctl.c b/usr.bin/sndioctl/sndioctl.c
index 81e7c900fdb..25c5b54f1f4 100644
--- a/usr.bin/sndioctl/sndioctl.c
+++ b/usr.bin/sndioctl/sndioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndioctl.c,v 1.8 2020/05/17 05:35:57 ratchov Exp $ */
+/* $OpenBSD: sndioctl.c,v 1.9 2020/05/17 05:37:49 ratchov Exp $ */
/*
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
*
@@ -885,9 +885,11 @@ onctl(void *arg, unsigned addr, unsigned val)
for (i = infolist; i != NULL; i = i->next) {
if (i->ctladdr != addr)
continue;
- i->curval = val;
- if (m_flag)
- print_ent(i, "changed");
+ if (i->curval != val) {
+ i->curval = val;
+ if (m_flag)
+ print_ent(i, "changed");
+ }
}
}