Index: sys/kern/sys_pipe.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/sys_pipe.c,v
retrieving revision 1.60.2.12
retrieving revision 1.60.2.13
diff -u -r1.60.2.12 -r1.60.2.13
--- sys/kern/sys_pipe.c	16 Apr 2002 02:08:13 -0000	1.60.2.12
+++ sys/kern/sys_pipe.c	5 Aug 2002 15:05:15 -0000	1.60.2.13
@@ -1237,6 +1237,9 @@
 	case EVFILT_WRITE:
 		kn->kn_fop = &pipe_wfiltops;
 		cpipe = cpipe->pipe_peer;
+		if (cpipe == NULL)
+			/* other end of pipe has been closed */
+			return (EBADF);
 		break;
 	default:
 		return (1);
