shithub: riscv

Download patch

ref: ac6cb9af2986745078a70b644d4f5fde49ba1b72
parent: ebb9acecddac0b64064f03711276d445ddf0646f
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jun 11 21:35:37 EDT 2020

ramfs: make Elocked[] more consistent (thanks fazlul)

Go expects the error to be one of the three errors returned in
Bell Labs Plan 9. As listed in
https://github.com/golang/go/blob/f7ba82d68f90e20aa9e6aa973cb6f12321abec71/src/cmd/go/internal/lockedfile/lockedfile_plan9.go#L16:

	// Opening an exclusive-use file returns an error.
	// The expected error strings are:
	//
	//  - "open/create -- file is locked" (cwfs, kfs)
	//  - "exclusive lock" (fossil)
	//  - "exclusive use file already open" (ramfs)
	var lockedErrStrings = [...]string{
		"file is locked",
		"exclusive lock",
		"exclusive use file already open",
	}

--- a/sys/src/cmd/ramfs.c
+++ b/sys/src/cmd/ramfs.c
@@ -11,7 +11,7 @@
 char Enomem[] = "no memory";
 char Eperm[] = "permission denied";
 char Enotowner[] = "not owner";
-char Elocked[] = "file locked";
+char Elocked[] = "file is locked";
 
 enum {
 	Tdat	= 0xbabababa,