From 9eb3f14324736fe9895cf83ab17756dfea8f7d8e Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 27 Jun 2016 23:34:53 +0000 Subject: [PATCH] Fix userspace build after r302235: do not expose bool field of the structure, change it to int. The real fix is to sanitize user-visible definitions in sys/event.h, e.g. the affected struct knlist is of no use for userspace programs. Reported and tested by: jkim Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb) --- sys/kern/kern_event.c | 4 ++-- sys/sys/event.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 97137d860f8..84bef459d23 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -2204,7 +2204,7 @@ knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), else knl->kl_assert_unlocked = kl_assert_unlocked; - knl->kl_autodestroy = false; + knl->kl_autodestroy = 0; SLIST_INIT(&knl->kl_list); } @@ -2255,7 +2255,7 @@ knlist_detach(struct knlist *knl) { KNL_ASSERT_LOCKED(knl); - knl->kl_autodestroy = true; + knl->kl_autodestroy = 1; if (knlist_empty(knl)) { knlist_destroy(knl); free(knl, M_KQUEUE); diff --git a/sys/sys/event.h b/sys/sys/event.h index d019307108e..139caff46c1 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -159,7 +159,7 @@ struct knlist { void (*kl_assert_locked)(void *); void (*kl_assert_unlocked)(void *); void *kl_lockarg; /* argument passed to lock functions */ - bool kl_autodestroy; + int kl_autodestroy; };