ref: 9b2d3d426665b65e3cbba33504f103e86896ec9a
parent: 9c71514b7158cfa8102b6a32775b783fcd9681ed
author: cinap_lenrek <cinap_lenrek@rei2.9hal>
date: Fri Mar 16 18:42:14 EDT 2012
ndb: avoid double /net/ndb
--- a/sys/src/cmd/ndb/cs.c
+++ b/sys/src/cmd/ndb/cs.c
@@ -336,6 +336,10 @@
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;
--- a/sys/src/cmd/ndb/dblookup.c
+++ b/sys/src/cmd/ndb/dblookup.c
@@ -72,6 +72,12 @@
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;
--
⑨