shithub: gefs

Download patch

ref: 81129e88677f7d4e6b71be8b6aa2f9136caeb617
parent: b09b15506cf7f89d0e42eab020cd4832015b1152
author: Michael Forney <mforney@mforney.org>
date: Sat Mar 12 17:49:10 EST 2022

change mode type to ulong
This matches the Dir structure. Not all mode bits (in particular
DMDIR) can be represented as int.

--- a/dat.h
+++ b/dat.h
@@ -479,7 +479,7 @@
 struct Xdir {
 	/* file data */
 	Qid	qid;	/* unique id from server */
-	int	mode;	/* permissions */
+	ulong	mode;	/* permissions */
 	vlong	atime;	/* last read time: nsec */
 	vlong	mtime;	/* last write time: nsec */
 	uvlong	length;	/* file length */
--- a/dump.c
+++ b/dump.c
@@ -82,7 +82,7 @@
 			if(kv2dir(v, &d) == -1)
 				n = fmtprint(fmt, "bad dir");
 			else
-				n = fmtprint(fmt, "[qid=(%llux,%lud,%d), %o, t=%lld,%lld, l=%lld]",
+				n = fmtprint(fmt, "[qid=(%llux,%lud,%d), %luo, t=%lld,%lld, l=%lld]",
 					d.qid.path, d.qid.vers, d.qid.type,
 					d.mode, d.atime, d.mtime, d.length);
 			break;
@@ -97,7 +97,7 @@
 				p += 8;
 			}
 			if(ws & Owmode){
-				n += fmtprint(fmt, "mode:%o ", GBIT32(p));
+				n += fmtprint(fmt, "mode:%uo ", GBIT32(p));
 				p += 4;
 			}
 			if(ws & Owmtime){
--- a/fs.c
+++ b/fs.c
@@ -665,7 +665,7 @@
 }
 
 static int
-fsaccess(Fid *f, int fmode, int fuid, int fgid, int m)
+fsaccess(Fid *f, ulong fmode, int fuid, int fgid, int m)
 {
 	/* uid none gets only other permissions */
 	if(f->uid != 0) {