FreeBSD/sbin/restore/dirs.c
/*
 * add a new directory entry to a file.
 */
add a new directory entry to a file.
add a new directory entry to a file .
static void
putent(struct direct *dp)
{
	dp->d_reclen = DIRSIZ(0, dp);
	if (dirloc + dp->d_reclen > DIRBLKSIZ) {
		((struct direct *)(dirbuf + prev))->d_reclen =
		    DIRBLKSIZ - prev;
		if (fwrite(dirbuf, DIRBLKSIZ, 1, df) != 1)
			fail_dirtmp(dirfile);
		dirloc = 0;
	}
	memmove(dirbuf + dirloc, dp, (long)dp->d_reclen);
	prev = dirloc;
	dirloc += dp->d_reclen;
}
static void putent ( struct direct * dp ) { dp -> d_reclen = DIRSIZ ( 0 , dp ) ; if ( dirloc + dp -> d_reclen > DIRBLKSIZ ) { ( ( struct direct * ) ( dirbuf + prev ) ) -> d_reclen = DIRBLKSIZ - prev ; if ( fwrite ( dirbuf , DIRBLKSIZ , 1 , df ) != 1 ) fail_dirtmp ( dirfile ) ; dirloc = 0 ; } memmove ( dirbuf + dirloc , dp , ( long ) dp -> d_reclen ) ; prev = dirloc ; dirloc += dp -> d_reclen ; }
add a new directory entry to a file.
add a new directory entry to a file .