From 52eec12892ff1a2d355e81f4331cc3fa413cf366 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 30 Nov 2017 14:19:27 +0000 Subject: [PATCH] Put previous removed diagnostic back as debug. It has caught in the past (and now) different kqueue behavior between NetBSD and other kqueue implementations that depend on specific file types. If 3rd party programs trigger this it is probably because we are doing something different. --- sys/kern/kern_event.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index e22bf90f35d9..0e2ca5c87eb1 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_event.c,v 1.99 2017/11/30 05:52:40 riastradh Exp $ */ +/* $NetBSD: kern_event.c,v 1.100 2017/11/30 14:19:27 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.99 2017/11/30 05:52:40 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.100 2017/11/30 14:19:27 christos Exp $"); #include #include @@ -1063,6 +1063,13 @@ kqueue_register(struct kqueue *kq, struct kevent *kev) error = (*kfilter->filtops->f_attach)(kn); KERNEL_UNLOCK_ONE(NULL); /* XXXSMP */ if (error != 0) { +#ifdef DEBUG + printf("%s: event type %d not supported for " + "file type %d (error %d)\n", __func__, + kn->kn_filter, kn->kn_obj ? + ((file_t *)kn->kn_obj)->f_type : -1, error); +#endif + /* knote_detach() drops fdp->fd_lock */ knote_detach(kn, fdp, false); goto done;