From 21e64560a7b4e16b4bbd212d2475017861ce7c31 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 31 Oct 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-10-31 --- port/devcons.c | 1 + port/devproc.c | 7 ++++--- port/devroot.c | 12 ++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/port/devcons.c b/port/devcons.c index 491e661245586b1f2be383b813bb7074570b427a..83d7e48d32ba8a0ba2776214a82136a5cd8df988 100644 --- a/port/devcons.c +++ b/port/devcons.c @@ -482,6 +482,7 @@ consclose(Chan *c) kbd.raw = 0; qunlock(&kbd); } + break; case Qauth: case Qauthcheck: case Qauthent: diff --git a/port/devproc.c b/port/devproc.c index 93b0ed1a74e3dce2241c97962dd70ceed39667a4..de89cb9878e312ebdb6f34d9f235fa8aac173f31 100644 --- a/port/devproc.c +++ b/port/devproc.c @@ -1,4 +1,4 @@ -#include "u.h" + #include "u.h" #include "../port/lib.h" #include "mem.h" #include "dat.h" @@ -521,8 +521,9 @@ procwrite(Chan *c, void *va, long n, ulong offset) { int id; Proc *p, *t, *et; - char buf[ERRLEN]; + char *a, buf[ERRLEN]; + a = va; if(c->qid.path & CHDIR) error(Eisdir); @@ -583,7 +584,7 @@ procwrite(Chan *c, void *va, long n, ulong offset) error("note not posted"); break; case Qnoteid: - id = atoi((char*)va); + id = atoi(a); if(id == p->pid) { p->noteid = id; break; diff --git a/port/devroot.c b/port/devroot.c index 39af63fa56c7ae24d6a17cfcd410dc6eafaf868b..791f8ebf71f3432e2df1c99437693a4c48905a79 100644 --- a/port/devroot.c +++ b/port/devroot.c @@ -33,6 +33,7 @@ Dirtab rootdir[Nfiles]={ static uchar *rootdata[Nfiles]; static int nroot = Qboot - 1; +static int recovbusy; typedef struct Recover Recover; struct Recover @@ -118,8 +119,11 @@ rootopen(Chan *c, int omode) default: break; case Qrecover: + if(recovbusy) + error(Einuse); if(strcmp(up->user, eve) != 0) error(Eperm); + recovbusy = 1; break; } @@ -140,6 +144,14 @@ void rootclose(Chan *c) { USED(c); + switch(c->qid.path) { + default: + break; + case Qrecover: + if(c->flag&COPEN) + recovbusy = 0; + break; + } } int