about summary refs log tree commit diff
path: root/db2/mp/mp_fset.c
diff options
context:
space:
mode:
Diffstat (limited to 'db2/mp/mp_fset.c')
-rw-r--r--db2/mp/mp_fset.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/db2/mp/mp_fset.c b/db2/mp/mp_fset.c
index a7d2706008..2eff7dd74c 100644
--- a/db2/mp/mp_fset.c
+++ b/db2/mp/mp_fset.c
@@ -7,7 +7,7 @@
 #include "config.h"
 
 #ifndef lint
-static const char sccsid[] = "@(#)mp_fset.c	10.10 (Sleepycat) 10/5/97";
+static const char sccsid[] = "@(#)mp_fset.c	10.12 (Sleepycat) 11/26/97";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -43,20 +43,21 @@ memp_fset(dbmfp, pgaddr, flags)
 	mp = dbmp->mp;
 
 	/* Validate arguments. */
-	if (flags != 0) {
-		if ((ret = __db_fchk(dbmp->dbenv, "memp_fset", flags,
-		    DB_MPOOL_DIRTY | DB_MPOOL_CLEAN | DB_MPOOL_DISCARD)) != 0)
-			return (ret);
-		if ((ret = __db_fcchk(dbmp->dbenv, "memp_fset",
-		    flags, DB_MPOOL_CLEAN, DB_MPOOL_DIRTY)) != 0)
-			return (ret);
+	if (flags == 0)
+		return (__db_ferr(dbmp->dbenv, "memp_fset", 1));
 
-		if (LF_ISSET(DB_MPOOL_DIRTY) && F_ISSET(dbmfp, MP_READONLY)) {
-			__db_err(dbmp->dbenv,
-			    "%s: dirty flag set for readonly file page",
-			    dbmfp->path);
-			return (EACCES);
-		}
+	if ((ret = __db_fchk(dbmp->dbenv, "memp_fset", flags,
+	    DB_MPOOL_DIRTY | DB_MPOOL_CLEAN | DB_MPOOL_DISCARD)) != 0)
+		return (ret);
+	if ((ret = __db_fcchk(dbmp->dbenv, "memp_fset",
+	    flags, DB_MPOOL_CLEAN, DB_MPOOL_DIRTY)) != 0)
+		return (ret);
+
+	if (LF_ISSET(DB_MPOOL_DIRTY) && F_ISSET(dbmfp, MP_READONLY)) {
+		__db_err(dbmp->dbenv,
+		    "%s: dirty flag set for readonly file page",
+		    __memp_fn(dbmfp));
+		return (EACCES);
 	}
 
 	/* Convert the page address to a buffer header. */