src/usr.sbin/mountd/mountd.c
/*
 * Search for a dirpath on the export point.
 */
Search for a dirpath on the export point.
Search for a dirpath on the export point .
static struct dirlist *
dirp_search(struct dirlist *dp, char *dirp)
{
	int cmp;
	if (dp) {
		cmp = strcmp(dp->dp_dirp, dirp);
		if (cmp > 0)
			return (dirp_search(dp->dp_left, dirp));
		else if (cmp < 0)
			return (dirp_search(dp->dp_right, dirp));
		else
			return (dp);
	}
	return (dp);
}
static struct dirlist * dirp_search ( struct dirlist * dp , char * dirp ) { int cmp ; if ( dp ) { cmp = strcmp ( dp -> dp_dirp , dirp ) ; if ( cmp > 0 ) return ( dirp_search ( dp -> dp_left , dirp ) ) ; else if ( cmp < 0 ) return ( dirp_search ( dp -> dp_right , dirp ) ) ; else return ( dp ) ; } return ( dp ) ; }
Search for a dirpath on the export point.
Search for a dirpath on the export point .