On the sndiod(8) side device controls are not ordered. While switching
from one device to another, a new control (of the new device) may
appear before an old control with the same name is removed. As
discussed in sioctl_open(3), once the full description increment is
fetched (i.e. the call-back is invoked with NULL sioctl_desc
structure) the representation of the control set is consistent.
-/* $OpenBSD: sndioctl.c,v 1.19 2023/01/31 21:38:01 ratchov Exp $ */
+/* $OpenBSD: sndioctl.c,v 1.20 2024/04/22 10:49:01 ratchov Exp $ */
/*
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
*
*/
for (pi = &infolist; (i = *pi) != NULL; pi = &i->next) {
cmp = cmpdesc(d, &i->desc);
- if (cmp == 0) {
- fprintf(stderr, "fatal: duplicate control:\n");
- print_ent(i, "duplicate");
- exit(1);
- }
- if (cmp < 0)
+ if (cmp <= 0)
break;
}
i = malloc(sizeof(struct info));