summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-09-22 19:49:59 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-09-22 19:49:59 +0200
commitb4cdfc6c5517390d6be05b2c01e56bacc9e85ea8 (patch)
treeccc32ef90f9599693a236415031a576a0a361f0c /sys
parent99167104f9d37ebce135ec16b506b47b62cfb975 (diff)
devproc: check for p->dot == nil, run closeproc with up->dot = up->slash
p->dot can be nil when process exits (see pexit()) set closeprocs dot to up->slash so it will show up right in devproc.
Diffstat (limited to 'sys')
-rw-r--r--sys/src/9/port/chan.c2
-rw-r--r--sys/src/9/port/devproc.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/9/port/chan.c b/sys/src/9/port/chan.c
index 9577eb8d3..6adb7f072 100644
--- a/sys/src/9/port/chan.c
+++ b/sys/src/9/port/chan.c
@@ -535,7 +535,7 @@ closechanq(Chan *c)
if(up != 0 && palloc.Lock.p != up && canqlock(&clunkq.q)){
c = up->dot;
- up->dot = nil;
+ up->dot = up->slash; /* dummy */
if(!waserror()){
kproc("closeproc", closeproc, nil);
poperror();
diff --git a/sys/src/9/port/devproc.c b/sys/src/9/port/devproc.c
index 663a0205d..e5fd24671 100644
--- a/sys/src/9/port/devproc.c
+++ b/sys/src/9/port/devproc.c
@@ -571,7 +571,7 @@ procfds(Proc *p, char *va, int count, long offset)
eqlock(&p->debug);
f = p->fgrp;
- if(f == nil){
+ if(f == nil || p->dot == nil){
qunlock(&p->debug);
return 0;
}
@@ -956,7 +956,7 @@ procread(Chan *c, void *va, long n, vlong off)
qunlock(&p->debug);
nexterror();
}
- if(p->pgrp == nil || p->pid != PID(c->qid))
+ if(p->pgrp == nil || p->dot == nil || p->pid != PID(c->qid))
error(Eprocdied);
mw = c->aux;
if(mw->cddone){