shithub: riscv

Download patch

ref: 07fdda9725f1c3d6fc1f25e0c230ad38574f7b7e
parent: 2a46d5c4f96294786a5cfab4b382e75c57b08744
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Tue Apr 12 17:44:11 EDT 2011

proper error message when no service set

--- a/sys/src/cmd/cwfs/main.c
+++ b/sys/src/cmd/cwfs/main.c
@@ -174,6 +174,9 @@
 	char buf[3*NAMELEN];
 	int p[2];
 
+	if(service[0] == 0)
+		panic("no service name");
+
 	if(sfd < 0){
 		if(pipe(p) < 0)
 			panic("can't make a pipe");
@@ -290,6 +293,7 @@
 	formatinit();
 	machinit();
 	conf.confdev = "/dev/sdC0/cwfs";
+	strcpy(service, "cwfs");
 
 	rfd = sfd = -1;
 
--