cdp = cf->cf_ddat;
cvs_file_getdir(struct cvs_file *cf, int flags){	int nf, ret, fd;	long base;	void *dp, *ep, *tmp;	char fbuf[1024], pbuf[MAXPATHLEN];	struct dirent *ent;	struct cvs_file *cfp;	struct cvs_dir *cdp;	if (cvs_readrepo(cf->cf_path, pbuf, sizeof(pbuf)) == 0) {		cdp->cd_repo = strdup(pbuf);		if (cdp->cd_repo == NULL) {			free(cdp);			return (-1);		}	}	cdp->cd_root = cvsroot_get(cf->cf_path);	if (cdp->cd_root == NULL) {		cvs_file_freedir(cdp);		return (-1);	}	fd = open(cf->cf_path, O_RDONLY);	if (fd == -1) {		cvs_log(LP_ERRNO, "failed to open `%s'", cf->cf_path);		cvs_file_freedir(cdp);		return (-1);	}	ret = getdirentries(fd, fbuf, sizeof(fbuf), &base);	if (ret == -1) {		cvs_log(LP_ERRNO, "failed to get directory entries");		(void)close(fd);		cvs_file_freedir(cdp);		return (-1);	}	dp = fbuf;	ep = fbuf + (size_t)ret;	while (dp < ep) {		ent = (struct dirent *)dp;		dp += ent->d_reclen;		if ((flags & CF_IGNORE) && cvs_file_chkign(ent->d_name))			continue;		snprintf(pbuf, sizeof(pbuf), "%s/%s", cf->cf_path, ent->d_name);		cfp = cvs_file_get(pbuf, flags);		if (cfp != NULL) {			cfp->cf_parent = cf;			LIST_INSERT_HEAD(&(cdp->cd_files), cfp, cf_list);		}	}	if (flags & CF_SORT)		cvs_file_sort(&(cdp->cd_files));	(void)close(fd);	cf->cf_ddat = cdp;	return (0);}