From owner-p4-projects@FreeBSD.ORG Mon Mar 20 18:55:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6CD0C16A427; Mon, 20 Mar 2006 18:55:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28E8416A401 for ; Mon, 20 Mar 2006 18:55:55 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 845C943D77 for ; Mon, 20 Mar 2006 18:55:47 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2KItlFw030626 for ; Mon, 20 Mar 2006 18:55:47 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2KItlAt030623 for perforce@freebsd.org; Mon, 20 Mar 2006 18:55:47 GMT (envelope-from millert@freebsd.org) Date: Mon, 20 Mar 2006 18:55:47 GMT Message-Id: <200603201855.k2KItlAt030623@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 93652 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Mar 2006 18:55:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=93652 Change 93652 by millert@millert_p3 on 2006/03/20 18:54:48 Back out fdcopy() changes to ease upcoming integration. Affected files ... .. //depot/projects/trustedbsd/sebsd/sys/kern/kern_descrip.c#20 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/sys/kern/kern_descrip.c#20 (text+ko) ==== @@ -1502,6 +1502,8 @@ newfdp->fd_fd.fd_cmask = CMASK; newfdp->fd_fd.fd_ofiles = newfdp->fd_dfiles; newfdp->fd_fd.fd_ofileflags = newfdp->fd_dfileflags; + newfdp->fd_fd.fd_lastfile = 0; /* XXX */ + newfdp->fd_fd.fd_freefile = 0; /* XXX */ newfdp->fd_fd.fd_nfiles = NDFILE; newfdp->fd_fd.fd_map = newfdp->fd_dmap; return (&newfdp->fd_fd); @@ -1592,6 +1594,8 @@ } /* copy everything except kqueue descriptors */ newfdp->fd_freefile = -1; + if (fdp->fd_lastfile < 0) + printf("%s: fd_lastfile is %d\n", __func__, fdp->fd_lastfile); for (i = 0; i <= fdp->fd_lastfile; ++i) { if (fdisused(fdp, i) && fdp->fd_ofiles[i]->f_type != DTYPE_KQUEUE) { @@ -1604,15 +1608,17 @@ newfdp->fd_freefile = i; } } - newfdp->fd_cmask = fdp->fd_cmask; FILEDESC_UNLOCK_FAST(fdp); FILEDESC_LOCK(newfdp); - if (newfdp->fd_freefile == -1) - newfdp->fd_freefile = i; for (i = 0; i <= newfdp->fd_lastfile; ++i) if (newfdp->fd_ofiles[i] != NULL) fdused(newfdp, i); FILEDESC_UNLOCK(newfdp); + FILEDESC_LOCK_FAST(fdp); + if (newfdp->fd_freefile == -1) + newfdp->fd_freefile = i; + newfdp->fd_cmask = fdp->fd_cmask; + FILEDESC_UNLOCK_FAST(fdp); return (newfdp); }