err:		bzero(sbp, sizeof(struct stat));
err:		__bzero(sbp, sizeof(struct stat));
fts_stat(sp, dp, p, follow)	FTS *sp;	register FTSENT *p;	struct dirent *dp;	int follow;{	register FTSENT *t;	register dev_t dev;	register ino_t ino;	struct stat *sbp, sb;	int saved_errno;	/* If user needs stat info, stat buffer already allocated. */	sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;#ifdef DT_WHT	/*	 * Whited-out files don't really exist.  However, there's stat(2) file	 * mask for them, so we set it so that programs (i.e., find) don't have	 * to test FTS_W separately from other file types.	 */	if (dp != NULL && dp->d_type == DT_WHT) {		memset(sbp, 0, sizeof(struct stat));		sbp->st_mode = S_IFWHT;		return (FTS_W);       }#endif	/*	 * If doing a logical walk, or application requested FTS_FOLLOW, do	 * a stat(2).  If that fails, check for a non-existent symlink.  If	 * fail, set the errno from the stat call.	 */	if (ISSET(FTS_LOGICAL) || follow) {		if (stat(p->fts_accpath, sbp)) {			saved_errno = errno;			if (!lstat(p->fts_accpath, sbp)) {				__set_errno (0);				return (FTS_SLNONE);			}			p->fts_errno = saved_errno;			goto err;		}	} else if (lstat(p->fts_accpath, sbp)) {		p->fts_errno = errno;err:		bzero(sbp, sizeof(struct stat));		return (FTS_NS);	}	if (S_ISDIR(sbp->st_mode)) {		/*		 * Set the device/inode.  Used to find cycles and check for		 * crossing mount points.  Also remember the link count, used		 * in fts_build to limit the number of stat calls.  It is		 * understood that these fields are only referenced if fts_info		 * is set to FTS_D.		 */		dev = p->fts_dev = sbp->st_dev;		ino = p->fts_ino = sbp->st_ino;		p->fts_nlink = sbp->st_nlink;		if (ISDOT(p->fts_name))			return (FTS_DOT);		/*		 * Cycle detection is done by brute force when the directory		 * is first encountered.  If the tree gets deep enough or the		 * number of symbolic links to directories is high enough,		 * something faster might be worthwhile.		 */		for (t = p->fts_parent;		    t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)			if (ino == t->fts_ino && dev == t->fts_dev) {				p->fts_cycle = t;				return (FTS_DC);			}		return (FTS_D);	}	if (S_ISLNK(sbp->st_mode))		return (FTS_SL);	if (S_ISREG(sbp->st_mode))		return (FTS_F);	return (FTS_DEFAULT);}