Commit:62f992b9b69dc0d2d4c95364def709eb5ad15ac7 (browse)
Parent:b8cc5e02b3662d1e98953e35034f33fff9715e7f
Author:Peter Mikkelsen <petermikkelsen10@gmail.com>
Date:Sat Feb 13 00:37:46 CET 2021
Message:
Remove two global variables

main.c => main.c
@@ -35,15 +35,6 @@
 Neinfile	*findfile(uvlong);
 void	fillstat(Dir*, Neinfile);
 
-Srv fs = {
-	.attach = fsattach,
-	.walk1 = fswalk1,
-	.clone = fsclone,
-	.stat = fsstat,
-	.read = fsread,
-	.write = fswrite,
-};
-
 char *username;
 
 Neinfile qroot[] = {
@@ -53,11 +44,18 @@
 
 Neinfile root = {"/", {Qroot, 0, QTDIR}, 555 | DMDIR};
 
-int nicknamecount;
-
 void
-main()
+main(void)
 {
+	Srv fs = {
+		.attach = fsattach,
+		.walk1 = fswalk1,
+		.clone = fsclone,
+		.stat = fsstat,
+		.read = fsread,
+		.write = fswrite,
+	};
+
 	chatty9p = 1;
 	char *mountpoint = "/mnt/neinchat";
 	username = getuser();
@@ -69,6 +67,7 @@
 void
 fsattach(Req *r)
 {
+	static int nicknamecount;
 	NeinAux *aux;
 
 	r->fid->qid = root.qid;