From 6130dd0b1c2c138b6b604fbf123c60fbfae1853b Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 24 Mar 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-03-24 --- ip/devip.c | 8 ++++++-- ip/ip.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ip/devip.c b/ip/devip.c index aaa904d1ebb29ddd1de53d34a1db57cc67fc06a5..263de0b13da78a392f76bc94b9b36b0cbc4a4427 100644 --- a/ip/devip.c +++ b/ip/devip.c @@ -166,6 +166,7 @@ ip1gen(Chan *c, int i, Dir *dp) case Qndb: p = "ndb"; len = strlen(f->ndb); + q.vers = f->ndbvers; break; case Qiproute: p = "iproute"; @@ -381,10 +382,12 @@ ipopen(Chan* c, int omode) default: break; case Qndb: - if(omode & (OWRITE|OTRUNC) && !iseve()) + if((omode & (OWRITE|OTRUNC)) && !iseve()) error(Eperm); - if((omode & (OWRITE|OTRUNC)) == (OWRITE|OTRUNC)) + if((omode & (OWRITE|OTRUNC)) == (OWRITE|OTRUNC)){ f->ndb[0] = 0; + f->ndbvers++; + } break; case Qlog: netlogopen(f); @@ -1370,6 +1373,7 @@ ndbwrite(Fs *f, char *a, ulong off, int n) error(Eio); memmove(f->ndb+off, a, n); f->ndb[off+n] = 0; + f->ndbvers++; return n; } diff --git a/ip/ip.h b/ip/ip.h index e40ae72a357d9389ba93693fadc16fe777609b24..86a33819087a75bf77d57db442d9684555c1dea7 100644 --- a/ip/ip.h +++ b/ip/ip.h @@ -293,6 +293,7 @@ struct Fs Ifclog *ilog; char ndb[1024]; /* an ndb entry for this interface */ + int ndbvers; }; int Fsconnected(Conv*, char*);