Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Deal with NULL file pointer for KTROP_CLEAR



details:   https://anonhg.NetBSD.org/src/rev/bd9800a09cab
branches:  trunk
changeset: 486770:bd9800a09cab
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sun May 28 15:27:51 2000 +0000

description:
Deal with NULL file pointer for KTROP_CLEAR

diffstat:

 sys/kern/kern_ktrace.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r 02c12540c9ce -r bd9800a09cab sys/kern/kern_ktrace.c
--- a/sys/kern/kern_ktrace.c    Sun May 28 10:33:14 2000 +0000
+++ b/sys/kern/kern_ktrace.c    Sun May 28 15:27:51 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_ktrace.c,v 1.42 2000/05/27 00:40:45 sommerfeld Exp $      */
+/*     $NetBSD: kern_ktrace.c,v 1.43 2000/05/28 15:27:51 sommerfeld Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -326,9 +326,10 @@
         * Mark fp non-blocking, to avoid problems from possible deadlocks.
         */
 
-       fp->f_flag |= FNONBLOCK;
-       (*fp->f_ops->fo_ioctl)(fp, FIONBIO, (caddr_t)&one, curp);
-
+       if (fp != NULL) {
+               fp->f_flag |= FNONBLOCK;
+               (*fp->f_ops->fo_ioctl)(fp, FIONBIO, (caddr_t)&one, curp);
+       }
        
        /*
         * need something to (un)trace (XXX - why is this here?)



Home | Main Index | Thread Index | Old Index