From 282e75f786384498caaa0677ad2737880f859407 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 26 Nov 1990 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1990-11-26 --- gnot/devdk.c | 4 +++- gnot/devmnt.c | 1 - gnot/devproc.c | 2 +- gnot/fault.c | 1 + gnot/page.c | 2 +- gnot/screen.c | 1 + gnot/sysfile.c | 11 +---------- port/devdk.c | 4 +++- port/devmnt.c | 1 - port/devproc.c | 2 +- port/page.c | 2 +- port/sysfile.c | 11 +---------- 12 files changed, 14 insertions(+), 28 deletions(-) diff --git a/gnot/devdk.c b/gnot/devdk.c index 6d2b4bb835e01f9958595a59e3d9342f88ff3dbb..fccc15f45e915ccaf28917bdf4c5ec05e17d141b 100644 --- a/gnot/devdk.c +++ b/gnot/devdk.c @@ -744,6 +744,8 @@ dkstat(Chan *c, char *dp) { if(c->qid.path == CHDIR) devstat(c, dp, dkdir, dk[c->dev].lines, devgen); + else if(c->qid.path == Dcloneqid) + devstat(c, dp, dkdir, 1, devgen); else devstat(c, dp, dksubdir, Nsubdir, streamgen); } @@ -776,7 +778,7 @@ dkopen(Chan *c, int omode) case Dcloneqid: dp = &dk[c->dev]; /* - * get an unused device and open it's control file + * get an unused device and open its control file */ end = &dp->line[dp->lines]; for(lp = &dp->line[dp->ncsc+1]; lp < end; lp++){ diff --git a/gnot/devmnt.c b/gnot/devmnt.c index b08e237c8f4571d8a5230ae83608d3619a1c76c0..3609c66d53fe6532fb11e4f4985a2898dd86b307 100644 --- a/gnot/devmnt.c +++ b/gnot/devmnt.c @@ -469,7 +469,6 @@ mntclunk(Chan *c, int t) Mnthdr *mh; MntQ *q; int waserr; -int ne = u->nerrlab; m = mntdev(c->dev, 0); mh = mhalloc(); diff --git a/gnot/devproc.c b/gnot/devproc.c index 721923161ed68775ec463553c59ade071ec5a95b..0df2184413388f223d752736c4bc426d677aa098 100644 --- a/gnot/devproc.c +++ b/gnot/devproc.c @@ -371,6 +371,7 @@ procwrite(Chan *c, void *va, long n) if(c->qid.path & CHDIR) error(Eisdir); + p = proctab(SLOT(c->qid)); /* * Special case: don't worry about process, just use remembered group */ @@ -390,7 +391,6 @@ procwrite(Chan *c, void *va, long n) return n; } - p = proctab(SLOT(c->qid)); lock(&p->debug); if(waserror()){ unlock(&p->debug); diff --git a/gnot/fault.c b/gnot/fault.c index 88ffc24def12376d0a6ecf36e7f96f37c7e30edc..c45bce849cb2c38f1e4012f1211dd811b82a1f38 100644 --- a/gnot/fault.c +++ b/gnot/fault.c @@ -61,6 +61,7 @@ fault(Ureg *ur, FFrame *f) } insyscall = u->p->insyscall; u->p->insyscall = 1; + addr = 0; /* set */ if(f->ssw & DF) addr = f->addr; else if(FORMAT(ur) == 0xA){ diff --git a/gnot/page.c b/gnot/page.c index 9a6b1ca90c2c49d961094d4003297e4480b6e3d8..a6b3d46bcdf21b40aa1757c924e4b4782c1f9bd7 100644 --- a/gnot/page.c +++ b/gnot/page.c @@ -306,7 +306,7 @@ loop: o->mqid = c->mqid; incref(c); }else{ - o->type = -1; + o->type = ~0; o->qid.path = -1; o->qid.vers = 0; o->mqid.path = -1; diff --git a/gnot/screen.c b/gnot/screen.c index f7081685073dc5069d5c055352e2009973086bea..41bd4f00ae98b62b7bd587d6fe928246eb4798d8 100644 --- a/gnot/screen.c +++ b/gnot/screen.c @@ -230,6 +230,7 @@ duartbaud(int b) int x; Duart *duart = DUARTREG; + x = 0; /* set */ switch(b){ case 38400: x = BD38400; diff --git a/gnot/sysfile.c b/gnot/sysfile.c index 76b85112e32b2560758090a615173c510d6e3e70..b15a6b8b2e49d466ca84fdd71565caa102ee98a5 100644 --- a/gnot/sysfile.c +++ b/gnot/sysfile.c @@ -29,6 +29,7 @@ fdtochan(int fd, int mode) { Chan *c; + c = 0; /* set */ if(fd<0 || NFD<=fd || (c=u->fd[fd])==0) error(Ebadfd); if(mode<0 || c->mode==ORDWR) @@ -332,16 +333,6 @@ sysstat(ulong *arg) return 0; } -long -sysaccess(ulong *arg) -{ - Chan *c; - long mode; - - postnote(u->p, 1, "access is deprecated", NDebug); - return 0; -} - long syschdir(ulong *arg) { diff --git a/port/devdk.c b/port/devdk.c index 6d2b4bb835e01f9958595a59e3d9342f88ff3dbb..fccc15f45e915ccaf28917bdf4c5ec05e17d141b 100644 --- a/port/devdk.c +++ b/port/devdk.c @@ -744,6 +744,8 @@ dkstat(Chan *c, char *dp) { if(c->qid.path == CHDIR) devstat(c, dp, dkdir, dk[c->dev].lines, devgen); + else if(c->qid.path == Dcloneqid) + devstat(c, dp, dkdir, 1, devgen); else devstat(c, dp, dksubdir, Nsubdir, streamgen); } @@ -776,7 +778,7 @@ dkopen(Chan *c, int omode) case Dcloneqid: dp = &dk[c->dev]; /* - * get an unused device and open it's control file + * get an unused device and open its control file */ end = &dp->line[dp->lines]; for(lp = &dp->line[dp->ncsc+1]; lp < end; lp++){ diff --git a/port/devmnt.c b/port/devmnt.c index b08e237c8f4571d8a5230ae83608d3619a1c76c0..3609c66d53fe6532fb11e4f4985a2898dd86b307 100644 --- a/port/devmnt.c +++ b/port/devmnt.c @@ -469,7 +469,6 @@ mntclunk(Chan *c, int t) Mnthdr *mh; MntQ *q; int waserr; -int ne = u->nerrlab; m = mntdev(c->dev, 0); mh = mhalloc(); diff --git a/port/devproc.c b/port/devproc.c index 721923161ed68775ec463553c59ade071ec5a95b..0df2184413388f223d752736c4bc426d677aa098 100644 --- a/port/devproc.c +++ b/port/devproc.c @@ -371,6 +371,7 @@ procwrite(Chan *c, void *va, long n) if(c->qid.path & CHDIR) error(Eisdir); + p = proctab(SLOT(c->qid)); /* * Special case: don't worry about process, just use remembered group */ @@ -390,7 +391,6 @@ procwrite(Chan *c, void *va, long n) return n; } - p = proctab(SLOT(c->qid)); lock(&p->debug); if(waserror()){ unlock(&p->debug); diff --git a/port/page.c b/port/page.c index c8a1dd617efd74e0b0a6bfcee0f81262091c0e1d..ae9d6fefb49c3c6019f79f64705fa51f5cae9358 100644 --- a/port/page.c +++ b/port/page.c @@ -336,7 +336,7 @@ loop: o->mqid = c->mqid; incref(c); }else{ - o->type = -1; + o->type = ~0; o->qid = (Qid){~0, ~0}; o->mqid = (Qid){~0, ~0}; o->mchan = 0; diff --git a/port/sysfile.c b/port/sysfile.c index a79f38d6f6506fab9c89bc2739695dd606ca11dc..c34e9eb0997458b6f7fefa8ea0ea5917437e1ac6 100644 --- a/port/sysfile.c +++ b/port/sysfile.c @@ -29,6 +29,7 @@ fdtochan(int fd, int mode) { Chan *c; + c = 0; /* set */ if(fd<0 || NFD<=fd || (c=u->fd[fd])==0) error(Ebadfd); if(mode<0 || c->mode==ORDWR) @@ -332,16 +333,6 @@ sysstat(ulong *arg) return 0; } -long -sysaccess(ulong *arg) -{ - Chan *c; - long mode; - - postnote(u->p, 1, "access is deprecated", NDebug); - return 0; -} - long syschdir(ulong *arg) {