diff options
Diffstat (limited to 'pipe.c')
-rw-r--r-- | pipe.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -86,7 +86,7 @@ pipe_write(struct pipe *p, char *addr, int n) for(i = 0; i < n; i++){ while(((p->writep + 1) % PIPESIZE) == p->readp){ - if(p->readopen == 0){ + if(p->readopen == 0 || curproc[cpu()]->killed){ release(&p->lock); return -1; } @@ -110,7 +110,7 @@ pipe_read(struct pipe *p, char *addr, int n) acquire(&p->lock); while(p->readp == p->writep){ - if(p->writeopen == 0){ + if(p->writeopen == 0 || curproc[cpu()]->killed){ release(&p->lock); return 0; } |