Module Name:    src
Committed By:   martin
Date:           Tue Jun 30 20:32:49 UTC 2009

Modified Files:
        src/sys/kern: kern_descrip.c

Log Message:
Update fd_freefile when kqueue descriptors are not copied from
parent to child. From Wolfgang Solfrank in PR kern/41651.
Approved by Andrew Doran.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/kern/kern_descrip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_descrip.c
diff -u src/sys/kern/kern_descrip.c:1.197 src/sys/kern/kern_descrip.c:1.198
--- src/sys/kern/kern_descrip.c:1.197	Mon Jun  8 00:19:56 2009
+++ src/sys/kern/kern_descrip.c	Tue Jun 30 20:32:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_descrip.c,v 1.197 2009/06/08 00:19:56 yamt Exp $	*/
+/*	$NetBSD: kern_descrip.c,v 1.198 2009/06/30 20:32:49 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.197 2009/06/08 00:19:56 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.198 2009/06/30 20:32:49 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1423,6 +1423,8 @@
 		}
 		if (__predict_false(fp->f_type == DTYPE_KQUEUE)) {
 			/* kqueue descriptors cannot be copied. */
+                       if (i < newfdp->fd_freefile)
+                               newfdp->fd_freefile = i;
 			continue;
 		}
 		/* It's active: add a reference to the file. */

Reply via email to