Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Morris committed Oct 16, 2019
1 parent f2df0fa commit 2821d43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kernel/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ allocproc(void)

// 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;

Expand Down

0 comments on commit 2821d43

Please sign in to comment.