diff options
author | Robert Morris <[email protected]> | 2019-10-16 12:27:08 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-10-16 12:27:08 -0400 |
commit | 2821d43cc95b4f9faf79ff94daa5d3a8ea5e7861 (patch) | |
tree | 0ec34b42cbdbea98da513fbd12d82bd6bb22e0f6 | |
parent | f2df0fa5471c9951ff9a12bea51efbe22afb196e (diff) | |
download | xv6-labs-2821d43cc95b4f9faf79ff94daa5d3a8ea5e7861.tar.gz xv6-labs-2821d43cc95b4f9faf79ff94daa5d3a8ea5e7861.tar.bz2 xv6-labs-2821d43cc95b4f9faf79ff94daa5d3a8ea5e7861.zip |
nits
-rw-r--r-- | kernel/pipe.c | 4 | ||||
-rw-r--r-- | kernel/proc.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/pipe.c b/kernel/pipe.c index e358283..c066afb 100644 --- a/kernel/pipe.c +++ b/kernel/pipe.c @@ -83,7 +83,7 @@ pipewrite(struct pipe *pi, uint64 addr, int n) acquire(&pi->lock); for(i = 0; i < n; i++){ while(pi->nwrite == pi->nread + PIPESIZE){ //DOC: pipewrite-full - if(pi->readopen == 0 || myproc()->killed){ + if(pi->readopen == 0 || pr->killed){ release(&pi->lock); return -1; } @@ -108,7 +108,7 @@ piperead(struct pipe *pi, uint64 addr, int n) acquire(&pi->lock); while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty - if(myproc()->killed){ + if(pr->killed){ release(&pi->lock); return -1; } diff --git a/kernel/proc.c b/kernel/proc.c index bbf3af0..ef2ad68 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -116,7 +116,7 @@ found: // Set up new context to start executing at forkret, // which returns to user space. - memset(&p->context, 0, sizeof p->context); + memset(&p->context, 0, sizeof(p->context)); p->context.ra = (uint64)forkret; p->context.sp = p->kstack + PGSIZE; |