-/* $OpenBSD: dev.c,v 1.108 2024/04/02 05:21:32 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.109 2024/04/22 10:39:51 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
return 1;
}
-void
+int
ctl_del(int scope, void *arg0, void *arg1)
{
struct ctl *c, **pc;
+ int found;
+ found = 0;
pc = &ctl_list;
for (;;) {
c = *pc;
if (c == NULL)
- return;
+ return found;
if (ctl_match(c, scope, arg0, arg1)) {
#ifdef DEBUG
if (log_level >= 2) {
log_puts(": removed\n");
}
#endif
+ found++;
c->refs_mask &= ~CTL_DEVMASK;
if (c->refs_mask == 0) {
*pc = c->next;
-/* $OpenBSD: dev.h,v 1.43 2022/12/26 19:16:03 jmc Exp $ */
+/* $OpenBSD: dev.h,v 1.44 2024/04/22 10:39:51 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
struct ctl *ctl_new(int, void *, void *,
int, char *, char *, int, char *, char *, int, int, int);
-void ctl_del(int, void *, void *);
+int ctl_del(int, void *, void *);
void ctl_log(struct ctl *);
int ctl_setval(struct ctl *c, int val);
int ctl_match(struct ctl *, int, void *, void *);