shithub: gefs

Download patch

ref: 6388170f199f4ec4a2b9005c0f6cf8c15c4efab0
parent: 8ca246b84f53a9c5da0d781aba0950ceb6dfa952
author: Michael Forney <mforney@mforney.org>
date: Tue Mar 1 16:26:34 EST 2022

print qid paths in hex to match other tools

--- a/cons.c
+++ b/cons.c
@@ -182,12 +182,14 @@
 	Tree *t;
 	Kvp kv;
 	Key k;
+	vlong pqid;
 
 	if((t = openlabel("main")) == nil){
 		fprint(fd, "could not open main snap\n");
 		return;
 	}
-	if((p = packdkey(kbuf, sizeof(kbuf), atoll(ap[0]), ap[1])) == nil){
+	pqid = strtoll(ap[0], nil, 16);
+	if((p = packdkey(kbuf, sizeof(kbuf), pqid, ap[1])) == nil){
 		fprint(fd, "could not pack key\n");
 		return;
 	}
--- a/dump.c
+++ b/dump.c
@@ -83,7 +83,7 @@
 			if(kv2dir(v, &d) == -1)
 				n = fmtprint(fmt, "bad dir");
 			else
-				n = fmtprint(fmt, "[qid=(%lld,%lud,%d), %o, t=%lld,%lld, l=%lld]",
+				n = fmtprint(fmt, "[qid=(%llux,%lud,%d), %o, t=%lld,%lld, l=%lld]",
 					d.qid.path, d.qid.vers, d.qid.type,
 					d.mode, d.atime, d.mtime, d.length);
 			break;