shithub: gefs

Download patch

ref: f6343dccd7c7a52c1f7688790fcf5822b5ece9ec
parent: dac3134b24202056232480f0e02cc3583ff8778e
author: Ori Bernstein <ori@eigenstate.org>
date: Sun May 7 22:02:40 EDT 2023

fs: return correct phase error on file errors

--- a/dat.h
+++ b/dat.h
@@ -153,6 +153,7 @@
 extern char Elocked[];
 extern char Eauthp[];
 extern char Eauthd[];
+extern char Eauthph[];
 extern char Ephase[];
 extern char Enone[];
 extern char Enoauth[];
--- a/error.c
+++ b/error.c
@@ -34,9 +34,10 @@
 char Elocked[]	= "open/create -- file is locked";
 char Eauthp[]	= "authread -- auth protocol not finished";
 char Eauthd[]	= "authread -- not enough data";
-char Ephase[]	= "auth phase error";
+char Eauthph[]	= "auth phase error";
 char Enone[]	= "auth -- user 'none' requires no authentication";
 char Enoauth[]	= "auth -- authentication disabled";
+char Ephase[]	= "phase error -- use after remove";
 
 char Ewstatb[]	= "wstat -- unknown bits in qid.type/mode";
 char Ewstatd[]	= "wstat -- attempt to change directory";
@@ -59,7 +60,6 @@
 //char Eentry[]		= "directory entry not found";
 //char Edir1[]		= "walk -- in a non-directory";
 //char Edir2[]		= "create -- in a non-directory";
-//char Ephase[]		= "phase error -- cannot happen";
 //char Edot[]		= "create/wstat -- . and .. illegal names";
 //char Ewalk[]		= "walk -- too many (system wide)";
 //char Eoffset[]	= "read/write -- offset negative";
--- a/fs.c
+++ b/fs.c
@@ -759,7 +759,7 @@
 		return nil;
 	case ARphase:
 	Phase:
-		return Ephase;
+		return Eauthph;
 	}
 }