FreeBSD/sbin/restore/dirs.c
/*
 * Lookup the requested name in directory inum.
 * Return its inode number if found, zero if it does not exist.
 */
Lookup the requested name in directory inum.
Return its inode number if found, zero if it does not exist.
Lookup the requested name in directory inum . Return its inode number if found zero if it does not exist .
static struct direct *
searchdir(ino_t	inum, char *name)
{
	struct direct *dp;
	struct inotab *itp;
	int len;
	itp = inotablookup(inum);
	if (itp == NULL)
		return (NULL);
	rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
	len = strlen(name);
	do {
		dp = rst_readdir(dirp);
		if (dp == NULL)
			return (NULL);
	} while (dp->d_namlen != len || strncmp(dp->d_name, name, len) != 0);
	return (dp);
}
static struct direct * searchdir ( ino_t inum , char * name ) { struct direct * dp ; struct inotab * itp ; int len ; itp = inotablookup ( inum ) ; if ( itp == NULL ) return ( NULL ) ; rst_seekdir ( dirp , itp -> t_seekpt , itp -> t_seekpt ) ; len = strlen ( name ) ; do { dp = rst_readdir ( dirp ) ; if ( dp == NULL ) return ( NULL ) ; } while ( dp -> d_namlen != len || strncmp ( dp -> d_name , name , len ) != 0 ) ; return ( dp ) ; }
Lookup the requested name in directory inum.
Lookup the requested name in directory inum .