version 1.38, 2009/11/03 21:31:37 |
version 1.39, 2009/11/05 08:36:48 |
|
|
rpipe_done(struct aproc *p) |
rpipe_done(struct aproc *p) |
{ |
{ |
struct file *f = p->u.io.file; |
struct file *f = p->u.io.file; |
|
struct abuf *obuf; |
|
|
if (f == NULL) |
if (f == NULL) |
return; |
return; |
|
/* |
|
* all buffers must be detached before deleting f->wproc, |
|
* because otherwise it could trigger this code again |
|
*/ |
|
obuf = LIST_FIRST(&p->obuflist); |
|
if (obuf) |
|
abuf_eof(obuf); |
if (f->wproc) { |
if (f->wproc) { |
f->rproc = NULL; |
f->rproc = NULL; |
aproc_del(f->wproc); |
aproc_del(f->wproc); |
|
|
wpipe_done(struct aproc *p) |
wpipe_done(struct aproc *p) |
{ |
{ |
struct file *f = p->u.io.file; |
struct file *f = p->u.io.file; |
|
struct abuf *ibuf; |
|
|
if (f == NULL) |
if (f == NULL) |
return; |
return; |
|
/* |
|
* all buffers must be detached before deleting f->rproc, |
|
* because otherwise it could trigger this code again |
|
*/ |
|
ibuf = LIST_FIRST(&p->ibuflist); |
|
if (ibuf) |
|
abuf_hup(ibuf); |
if (f->rproc) { |
if (f->rproc) { |
f->wproc = NULL; |
f->wproc = NULL; |
aproc_del(f->rproc); |
aproc_del(f->rproc); |