From a56cb94b432f3e713d8d887b7ed07df55b18863c Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Sun, 28 May 2000 15:27:51 +0000 Subject: [PATCH] Deal with NULL file pointer for KTROP_CLEAR --- sys/kern/kern_ktrace.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 08c92638a685..84f3a5631e44 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -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 @@ ktrace_common (curp, ops, facs, pid, fp) * 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?)