FreeBSD/usr.sbin/mountd/mountd.c
/*
 * Add a directory path to the list.
 */
Add a directory path to the list.
Add a directory path to the list .
static char *
add_expdir(struct dirlist **dpp, char *cp, int len)
{
	struct dirlist *dp;
	dp = (struct dirlist *)malloc(sizeof (struct dirlist) + len);
	if (dp == (struct dirlist *)NULL)
		out_of_mem();
	dp->dp_left = *dpp;
	dp->dp_right = (struct dirlist *)NULL;
	dp->dp_flag = 0;
	dp->dp_hosts = (struct hostlist *)NULL;
	strcpy(dp->dp_dirp, cp);
	*dpp = dp;
	return (dp->dp_dirp);
}
static char * add_expdir ( struct dirlist * * dpp , char * cp , int len ) { struct dirlist * dp ; dp = ( struct dirlist * ) malloc ( sizeof ( struct dirlist ) + len ) ; if ( dp == ( struct dirlist * ) NULL ) out_of_mem ( ) ; dp -> dp_left = * dpp ; dp -> dp_right = ( struct dirlist * ) NULL ; dp -> dp_flag = 0 ; dp -> dp_hosts = ( struct hostlist * ) NULL ; strcpy ( dp -> dp_dirp , cp ) ; * dpp = dp ; return ( dp -> dp_dirp ) ; }
Add a directory path to the list.
Add a directory path to the list .