shithub: riscv

Download patch

ref: a0b737ad35ca546f8ae14442a39e48d43daf4292
parent: 4fdc7dbe9c1c6530cf30e367a3db9c8ce0d14a57
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Tue Oct 23 04:55:26 EDT 2012

create bio file (/adm/keys.who) if it doesnt exist

--- a/sys/src/cmd/auth/lib/wrbio.c
+++ b/sys/src/cmd/auth/lib/wrbio.c
@@ -11,8 +11,11 @@
 	int i, fd, n;
 
 	fd = open(file, OWRITE);
-	if(fd < 0)
-		error("can't open %s", file);
+	if(fd < 0){
+		fd = create(file, OWRITE, 0660);
+		if(fd < 0)
+			error("can't create %s", file);
+	}
 	if(seek(fd, 0, 2) < 0)
 		error("can't seek %s", file);
 
--