ref: c636d0954ba47fbd8883a01d1167c9c92f47acea
parent: bcf1eb425dd4c90a3bfcd004f6aee3854259da78
author: Jacob Moody <moody@posixcafe.org>
date: Sun Mar 10 00:07:30 EDT 2024
kern: sync does not exist error change from 9front
--- a/kern/chan.c
+++ b/kern/chan.c
@@ -830,7 +830,6 @@
* Either walks all the way or not at all. No partial results in *cp.
* *nerror is the number of names to display in an error message.
*/
-static char Edoesnotexist[] = "does not exist";
int
walk(Chan **cp, char **names, int nnames, int nomount, int *nerror)
{
@@ -946,7 +945,7 @@
if(wq->nqid == 0 || (wq->qid[wq->nqid-1].type&QTDIR) != 0){
if(nerror)
*nerror = nhave+wq->nqid+1;
- kstrcpy(up->errstr, Edoesnotexist, ERRMAX);
+ kstrcpy(up->errstr, Enonexist, ERRMAX);
}else{
if(nerror)
*nerror = nhave+wq->nqid;
@@ -1084,7 +1083,7 @@
}
}
-static void
+void
namelenerror(char *aname, int len, char *err)
{
char *ename, *name, *next;
@@ -1127,14 +1126,8 @@
snprint(up->genbuf, sizeof up->genbuf, "...%.*s",
utfnlen(name, ename-name), name);
}
- snprint(up->errstr, ERRMAX, "%#q %s", up->genbuf, err);
+ snprint(up->errstr, ERRMAX, "%s: %#q", err, up->genbuf);
nexterror();
-}
-
-void
-nameerror(char *name, char *err)
-{
- namelenerror(name, strlen(name), err);
}
/*