Module Name:    src
Committed By:   yamt
Date:           Thu Oct 13 14:40:06 UTC 2011

Modified Files:
        src/share/examples/puffs/pgfs: pgfs_subs.c

Log Message:
isempty: fix a query result type.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/examples/puffs/pgfs/pgfs_subs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/examples/puffs/pgfs/pgfs_subs.c
diff -u src/share/examples/puffs/pgfs/pgfs_subs.c:1.2 src/share/examples/puffs/pgfs/pgfs_subs.c:1.3
--- src/share/examples/puffs/pgfs/pgfs_subs.c:1.2	Wed Oct 12 16:24:39 2011
+++ src/share/examples/puffs/pgfs/pgfs_subs.c	Thu Oct 13 14:40:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pgfs_subs.c,v 1.2 2011/10/12 16:24:39 yamt Exp $	*/
+/*	$NetBSD: pgfs_subs.c,v 1.3 2011/10/13 14:40:06 yamt Exp $	*/
 
 /*-
  * Copyright (c)2010,2011 YAMAMOTO Takashi,
@@ -46,7 +46,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: pgfs_subs.c,v 1.2 2011/10/12 16:24:39 yamt Exp $");
+__RCSID("$NetBSD: pgfs_subs.c,v 1.3 2011/10/13 14:40:06 yamt Exp $");
 #endif /* not lint */
 
 #include <assert.h>
@@ -906,10 +906,8 @@ check_path(struct Xconn *xc, fileid_t ga
 int
 isempty(struct Xconn *xc, fileid_t fileid, bool *emptyp)
 {
-	fileid_t dummy;
+	int32_t dummy;
 	static struct cmd *c;
-	static const Oid types[] = { INT8OID, };
-	struct fetchstatus s;
 	int error;
 
 	CREATECMD(c,
@@ -919,9 +917,7 @@ isempty(struct Xconn *xc, fileid_t filei
 	if (error != 0) {
 		return error;
 	}
-	fetchinit(&s, xc);
-	error = FETCHNEXT(&s, types, &dummy);
-	fetchdone(&s);
+	error = simplefetch(xc, INT4OID, &dummy);
 	assert(error != 0 || dummy == 1);
 	if (error == ENOENT) {
 		*emptyp = true;

Reply via email to