git: 9front

Download patch

ref: 0ee46df5fda935e1d3285aef556ae7f2d56333f5
parent: bb603e3caf769bd5e5513410594db6392f3883e5
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Wed Sep 7 04:10:35 EDT 2011

cwfs: cfs needs to run after con_session(), so revert previous change and just run consserve() before starting the srv procs

--- a/sys/src/cmd/cwfs/con.c
+++ b/sys/src/cmd/cwfs/con.c
@@ -6,6 +6,7 @@
 static	int	whoflag;
 
 static	void	consserve1(void *);
+static	void	installcmds(void);
 
 void
 consserve(void)
@@ -13,7 +14,12 @@
 	int i;
 
 	strncpy(cons.chan->whochan, "console", sizeof(cons.chan->whochan));
+	installcmds();
 	con_session();
+	cmd_exec("cfs");
+	cmd_exec("users");
+	cmd_exec("version");
+
 	for(i = 0; command[i].arg0; i++)
 		if(strcmp("cwcmd", command[i].arg0) == 0){
 			cmd_exec("cwcmd touchsb");
@@ -744,7 +750,7 @@
 	chatty = atoi(argv[1]);
 }
 
-void
+static void
 installcmds(void)
 {
 	cmd_install("allow", "-- disable permission checking", cmd_allow);
--- a/sys/src/cmd/cwfs/main.c
+++ b/sys/src/cmd/cwfs/main.c
@@ -373,11 +373,6 @@
 	sysinit();
 	srvinit();
 
-	installcmds();
-	cmd_exec("cfs");
-	cmd_exec("users");
-	cmd_exec("version");
-
 	/*
 	 * post filedescriptors to /srv
 	 */
@@ -384,6 +379,11 @@
 	postservice();
 
 	/*
+	 * processes to read the console
+	 */
+	consserve();
+
+	/*
 	 * Ethernet i/o processes
 	 */
 	netstart();
@@ -408,11 +408,6 @@
 	 * "sync" copy process
 	 */
 	newproc(synccopy, 0, "scp");
-
-	/*
-	 * processes to read the console
-	 */
-	consserve();
 
 	/* success */
 	exits(nil);
--- a/sys/src/cmd/cwfs/portfns.h
+++ b/sys/src/cmd/cwfs/portfns.h
@@ -29,7 +29,6 @@
 int	cksum0(int, int);
 void	cyclstart(void);
 void	dotrace(int);
-void	installcmds(void);
 void	consserve(void);
 int	conslock(void);
 int	con_attach(int, char*, char*);
--