shithub: plan9front

Download patch

ref: a73f41bf4ee5fbee20391922ed56c0310e3ccae9
parent: 659496081ef3517f09689678c070ad1967bd394e
author: Igor Böhm <igor@9lab.org>
date: Tue Oct 5 05:27:45 EDT 2021

sam: fix spurious overwrite message (patch from plan9port)

Fixes:

% sam -d
 -.
w /tmp/foo
/tmp/foo: (new file) #0
w /tmp/foo
?warning: write might change good version of `/tmp/foo'

--- a/sys/src/cmd/sam/io.c	Wed Oct  6 09:37:39 2021
+++ b/sys/src/cmd/sam/io.c	Tue Oct  5 05:27:45 2021
@@ -66,7 +66,7 @@
 		warn(Wnotnewline);
 	closeio(n);
 	if(f->name.s[0]==0 || samename){
-		if(statfile(name, &dev, &qid, &mtime, 0, 0) > 0){
+		if(statfile(genc, &dev, &qid, &mtime, 0, 0) > 0){
 			f->dev = dev;
 			f->qidpath = qid;
 			f->mtime = mtime;