M port/devcons.c => port/devcons.c +1 -0
@@ 482,6 482,7 @@ consclose(Chan *c)
kbd.raw = 0;
qunlock(&kbd);
}
+ break;
case Qauth:
case Qauthcheck:
case Qauthent:
M port/devproc.c => port/devproc.c +4 -3
@@ 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;
M port/devroot.c => port/devroot.c +12 -0
@@ 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