summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/cmd/ndb/cs.c4
-rw-r--r--sys/src/cmd/ndb/dblookup.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/src/cmd/ndb/cs.c b/sys/src/cmd/ndb/cs.c
index 10ecee536..3ab49efe4 100644
--- a/sys/src/cmd/ndb/cs.c
+++ b/sys/src/cmd/ndb/cs.c
@@ -336,6 +336,10 @@ ndbinit(void)
if(db == nil)
error("can't open network database");
+ for(netdb = db; netdb; netdb = netdb->next)
+ if(strcmp(netdb->file, netndb) == 0)
+ return;
+
netdb = ndbopen(netndb);
if(netdb != nil){
netdb->nohash = 1;
diff --git a/sys/src/cmd/ndb/dblookup.c b/sys/src/cmd/ndb/dblookup.c
index 5c3995f7e..9ff423d2c 100644
--- a/sys/src/cmd/ndb/dblookup.c
+++ b/sys/src/cmd/ndb/dblookup.c
@@ -72,6 +72,12 @@ opendatabase(void)
xdb = ndbopen(dbfile); /* /lib/ndb */
snprint(netdbnm, sizeof netdbnm, "%s/ndb", mntpt);
+ for(netdb = xdb; netdb; netdb = netdb->next)
+ if(strcmp(netdb->file, netdbnm) == 0){
+ db = xdb;
+ return 0;
+ }
+
netdb = ndbopen(netdbnm); /* /net/ndb */
if(netdb)
netdb->nohash = 1;