shithub: 9ferno

Download patch

ref: 56f288fc064620947503e2e05cca3d2eb3ffa345
parent: 98e5aeb994e29e3f52eb516f0cd2fddd1b5d721c
author: 9ferno <gophone2015@gmail.com>
date: Sat Nov 13 09:45:02 EST 2021

fixed bugs in ndb/cs and ndb/dns

--- a/appl/cmd/ndb/cs.b	Fri Nov 12 22:48:37 2021
+++ b/appl/cmd/ndb/cs.b	Sat Nov 13 09:45:02 2021
@@ -119,8 +119,11 @@
 	if(srv != nil)
 		srv->init();
 
-	sys->remove(svcname+"/cs");
-	sys->unmount(svcname, mntpt);
+	(ok, nil) := sys->stat(svcname+"/cs");
+	if(ok == 0) {
+		sys->remove(svcname+"/cs");
+		sys->unmount(svcname, mntpt);
+	}
 	publish(svcname);
 	if(sys->bind(svcname, mntpt, Sys->MBEFORE) < 0)
 		error(sys->sprint("can't bind #s on %s: %r", mntpt));
--- a/appl/cmd/ndb/dns.b	Fri Nov 12 22:48:37 2021
+++ b/appl/cmd/ndb/dns.b	Sat Nov 13 09:45:02 2021
@@ -144,8 +144,11 @@
 	stderr = sys->fildes(2);
 	readservers();
 	now = time();
-	sys->remove(svcname+"/dns");
-	sys->unmount(svcname, mntpt);
+	(ok, nil) := sys->stat(svcname+"/dns");
+	if(ok == 0) {
+		sys->remove(svcname+"/dns");
+		sys->unmount(svcname, mntpt);
+	}
 	publish(svcname);
 	if(sys->bind(svcname, mntpt, Sys->MBEFORE) < 0)
 		error(sys->sprint("can't bind #s on %s: %r", mntpt));