Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern fp == NULL in the DIAGNOSTIC, so use the real fp an...



details:   https://anonhg.NetBSD.org/src/rev/ff4b890e323a
branches:  trunk
changeset: 823796:ff4b890e323a
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 09 21:18:51 2017 +0000

description:
fp == NULL in the DIAGNOSTIC, so use the real fp and also print the errno.

diffstat:

 sys/kern/kern_event.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r d867e348dc3c -r ff4b890e323a sys/kern/kern_event.c
--- a/sys/kern/kern_event.c     Tue May 09 21:17:54 2017 +0000
+++ b/sys/kern/kern_event.c     Tue May 09 21:18:51 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_event.c,v 1.89 2017/04/27 16:52:22 abhinav Exp $  */
+/*     $NetBSD: kern_event.c,v 1.90 2017/05/09 21:18:51 christos Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.89 2017/04/27 16:52:22 abhinav Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.90 2017/05/09 21:18:51 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1021,7 +1021,8 @@
                        if (error != 0) {
 #ifdef DIAGNOSTIC
                                printf("%s: event not supported for file type"
-                                   " %d\n", __func__, fp ? fp->f_type : -1);
+                                   " %d (error %d)\n", __func__,
+                                   ((file_t *)kn->kn_obj)->f_type, error);
 #endif
                                /* knote_detach() drops fdp->fd_lock */
                                knote_detach(kn, fdp, false);



Home | Main Index | Thread Index | Old Index