(ret = __db_seek(fd, 0, 0, sizeof(HDR), SEEK_SET)) != 0 ||
(ret = __db_seek(fd, 0, 0, sizeof(HDR), 0, SEEK_SET)) != 0 ||
__log_valid(dblp, lp, cnt)	DB_LOG *dblp;	LOG *lp;	int cnt;{	LOGP persist;	ssize_t nw;	int fd, ret;	char *p;	if ((ret = __log_name(dblp, cnt, &p)) != 0)		return (ret);	fd = -1;	if ((ret = __db_open(p,	    DB_RDONLY | DB_SEQUENTIAL,	    DB_RDONLY | DB_SEQUENTIAL, 0, &fd)) != 0 ||	    (ret = __db_seek(fd, 0, 0, sizeof(HDR), SEEK_SET)) != 0 ||	    (ret = __db_read(fd, &persist, sizeof(LOGP), &nw)) != 0 ||	    nw != sizeof(LOGP)) {		if (ret == 0)			ret = EIO;		if (fd != -1) {			(void)__db_close(fd);			__db_err(dblp->dbenv,			    "Ignoring log file: %s: %s", p, strerror(ret));		}		goto err;	}	(void)__db_close(fd);	if (persist.magic != DB_LOGMAGIC) {		__db_err(dblp->dbenv,		    "Ignoring log file: %s: magic number %lx, not %lx",		    p, (u_long)persist.magic, (u_long)DB_LOGMAGIC);		ret = EINVAL;		goto err;	}	if (persist.version < DB_LOGOLDVER || persist.version > DB_LOGVERSION) {		__db_err(dblp->dbenv,		    "Ignoring log file: %s: unsupported log version %lu",		    p, (u_long)persist.version);		ret = EINVAL;		goto err;	}	if (lp != NULL) {		lp->persist.lg_max = persist.lg_max;		lp->persist.mode = persist.mode;	}	ret = 0;err:	FREES(p);	return (ret);}