From 9623ce351006ab792fd267f721584f33c88af6a6 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 4 Dec 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-12-04 --- alphapc/devether.c | 7 +------ bitsy/devether.c | 7 +------ boot/bootauth.c | 1 + ip/devip.c | 16 ++-------------- pc/devether.c | 7 +------ pc/devusb.c | 4 ++-- pc/devvga.c | 9 +++++---- port/chan.c | 10 +++------- port/devenv.c | 2 +- 9 files changed, 17 insertions(+), 46 deletions(-) diff --git a/alphapc/devether.c b/alphapc/devether.c index e9266a16584ed79e8e3b94126732e9603dce6896..333d1bf1b76b41593ba6c98d4db622f4167090ea 100644 --- a/alphapc/devether.c +++ b/alphapc/devether.c @@ -91,11 +91,6 @@ etherbread(Chan* chan, long n, ulong offset) return netifbread(etherxx[chan->dev], chan, n, offset); } -static void -etherremove(Chan*) -{ -} - static int etherwstat(Chan* chan, uchar* dp, int n) { @@ -446,6 +441,6 @@ Dev etherdevtab = { etherbread, etherwrite, etherbwrite, - etherremove, + devremove, etherwstat, }; diff --git a/bitsy/devether.c b/bitsy/devether.c index a5407b90b0f9a6d0d465e57822af32e0f3a48eac..1f93800d378d2d115d842e7c40ba6674629f9598 100644 --- a/bitsy/devether.c +++ b/bitsy/devether.c @@ -185,11 +185,6 @@ etherbread(Chan* chan, long n, ulong offset) return netifbread(etherxx[chan->dev], chan, n, offset); } -static void -etherremove(Chan*) -{ -} - static int etherwstat(Chan* chan, uchar* dp, int n) { @@ -460,7 +455,7 @@ Dev etherdevtab = { etherbread, etherwrite, etherbwrite, - etherremove, + devremove, etherwstat, nil, /* no power management */ etherconfig, diff --git a/boot/bootauth.c b/boot/bootauth.c index bc387327b12d211c5f5f2f256c908f906f6dced6..14cc4f73b7317d6ff62412ee4fd42272ea4f14b8 100644 --- a/boot/bootauth.c +++ b/boot/bootauth.c @@ -17,6 +17,7 @@ authentication(int cpuflag) av = argv; av[ac++] = "factotum"; //av[ac++] = "-d"; +//av[ac++] = "-D"; //9p messages if(cpuflag) av[ac++] = "-S"; else diff --git a/ip/devip.c b/ip/devip.c index 8c7579ddc5692d7f595dff842d5b24580f1ac78b..89392262fd5e883020462ec0f35eaf03e8d9838f 100644 --- a/ip/devip.c +++ b/ip/devip.c @@ -499,18 +499,6 @@ ipopen(Chan* c, int omode) return c; } -static void -ipcreate(Chan*, char*, int, ulong) -{ - error(Eperm); -} - -static void -ipremove(Chan*) -{ - error(Eperm); -} - static int ipwstat(Chan *c, uchar *dp, int n) { @@ -1187,13 +1175,13 @@ Dev ipdevtab = { ipwalk, ipstat, ipopen, - ipcreate, + devcreate, ipclose, ipread, ipbread, ipwrite, ipbwrite, - ipremove, + devremove, ipwstat, }; diff --git a/pc/devether.c b/pc/devether.c index 75ad714eadef88f2b8b889e8bd6642270d794643..be33331a7c0de34c6805c7785fe9cb091d503b5a 100644 --- a/pc/devether.c +++ b/pc/devether.c @@ -91,11 +91,6 @@ etherbread(Chan* chan, long n, ulong offset) return netifbread(etherxx[chan->dev], chan, n, offset); } -static void -etherremove(Chan*) -{ -} - static int etherwstat(Chan* chan, uchar* dp, int n) { @@ -466,6 +461,6 @@ Dev etherdevtab = { etherbread, etherwrite, etherbwrite, - etherremove, + devremove, etherwstat, }; diff --git a/pc/devusb.c b/pc/devusb.c index 514472216d40cddb70482ad771790b63391cfc60..36a631014ce45b410b7f0a69de444112e426ca4d 100644 --- a/pc/devusb.c +++ b/pc/devusb.c @@ -1700,9 +1700,9 @@ usbclose(Chan *c) if(c->qid.type == QTDIR || QID(c->qid) < Q3rd) return; qlock(&usbstate); - if(waserror()){ + if(waserror()){ /* usbdevice can error */ qunlock(&usbstate); - return; + nexterror(); } d = usbdevice(c); if(QID(c->qid) == Qctl) diff --git a/pc/devvga.c b/pc/devvga.c index 188762d38c112c09d3de87315d4c5a473d1581bb..42176638d035406e140a7ad9b30387787df0117a 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -112,14 +112,15 @@ vgaclose(Chan* c) static char *closectl = "closectl\n"; scr = &vgascreen[0]; - if ((ulong)c->qid.path == Qvgaovlctl) { - if (scr->dev->ovlctl){ - if(waserror()) + if((ulong)c->qid.path == Qvgaovlctl) + if(scr->dev->ovlctl){ + if(waserror()){ + print("ovlctl error: %s\n", up->errstr); return; + } scr->dev->ovlctl(scr, c, closectl, strlen(closectl)); poperror(); } - } } static void diff --git a/port/chan.c b/port/chan.c index 0b2159de8b342617db8d765d66bb03c559f8c01e..88c8d14e2a3ac66f729cb9b0d263578231731887 100644 --- a/port/chan.c +++ b/port/chan.c @@ -352,14 +352,10 @@ cclose(Chan *c) if(decref(c)) return; - if(waserror()){ - print("cclose error: type %C; error %s\n", devtab[c->type]->dc, up!=nil? up->errstr : "no user"); - /* don't chanfree: better leak than leave a dangling pointer */ - return; + if(!waserror()){ + devtab[c->type]->close(c); + poperror(); } - - devtab[c->type]->close(c); - poperror(); chanfree(c); } diff --git a/port/devenv.c b/port/devenv.c index 44452ee785b5debffef1703ab4088a552164383e..55123835168b94008a5ead547740f1a803f1afa2 100644 --- a/port/devenv.c +++ b/port/devenv.c @@ -178,7 +178,7 @@ static void envclose(Chan *c) { /* - * close can't fail, so errors from remove will be ignored anyway. + * cclose can't fail, so errors from remove will be ignored. * since permissions aren't checked, * envremove can't not remove it if its there. */