From 6bef71f8edb55c1c60630fc00a21001f59b9fb35 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 23 Mar 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-03-23 --- port/dev.c | 4 ++++ port/devmnt.c | 5 +++-- port/net.c | 2 ++ port/portdat.h | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/port/dev.c b/port/dev.c index b97ec88f98fb08e698aba0709785fedfc4883a68..6f6365e772d0303d85d5db9f581f5a519561c998 100644 --- a/port/dev.c +++ b/port/dev.c @@ -41,6 +41,8 @@ devdir(Chan *c, Qid qid, char *n, long length, char *user, long perm, Dir *db) db->mode = CHDIR|perm; else db->mode = perm; + if(c->flag&CMSG) + db->mode |= CHMOUNT; db->atime = seconds(); db->mtime = kerndate; db->hlength = 0; @@ -144,6 +146,8 @@ devstat(Chan *c, char *db, Dirtab *tab, int ntab, Devgen *gen) error(Enonexist); case 1: if(eqqid(c->qid, dir.qid)) { + if(c->flag&CMSG) + dir.mode |= CHMOUNT; convD2M(&dir, db); return; } diff --git a/port/devmnt.c b/port/devmnt.c index 5909d2328d1dddc988a5793b5c68a7b15ca1ea91..ce4c7733cfdcda92301dfbbcdd03beb64fc24f90 100644 --- a/port/devmnt.c +++ b/port/devmnt.c @@ -160,9 +160,10 @@ mntattach(char *muxattach) c = mattach(m, bogus.spec, bogus.serv); mc = m->c; - if(mc->type == devno('M', 0)) { + if(mc->type == devno('M', 0) && (c->qid.path&CHDIR) == 0) { + c->qid.path |= CHDIR; c->mntptr = mc->mntptr; - c->mchan = c->mntptr->c; + c->mchan = mc->mntptr->c; c->mqid = c->qid; incref(c->mntptr); mclose(m); diff --git a/port/net.c b/port/net.c index 91f677c17b265fb4f5b6450b0f0f337db1139eab..0d9728108bfd192853e7fb2aefc0a7764d7de56f 100644 --- a/port/net.c +++ b/port/net.c @@ -157,6 +157,8 @@ netstat(Chan *c, char *db, Network *np) break; case 1: if(eqqid(c->qid, dir.qid)){ + if(c->flag&CMSG) + dir.mode |= CHMOUNT; convD2M(&dir, db); return; } diff --git a/port/portdat.h b/port/portdat.h index 24242c8af9e4373713b345ac354b1cedcea8c7cf..a4e9323696208185f662e948b4ef3f12ef786df7 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -766,6 +766,7 @@ enum CHDIR = 0x80000000L, CHAPPEND = 0x40000000L, CHEXCL = 0x20000000L, + CHMOUNT = 0x10000000L, }; /*