Date: Mon, 20 Mar 2006 18:55:47 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93652 for review Message-ID: <200603201855.k2KItlAt030623@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603201855.k2KItlAt030623>