From: Ben Gras Date: Tue, 29 Jun 2010 12:08:37 +0000 (+0000) Subject: MF_REPLY_PEND should be removed when sendrec finishes X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch03.html?a=commitdiff_plain;h=57ed4bbb517b383e0da149688802ce9b77d29392;p=minix.git MF_REPLY_PEND should be removed when sendrec finishes (r7565 from trunk) --- diff --git a/kernel/proc.c b/kernel/proc.c index 70983478c..49ed85b87 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -561,6 +561,10 @@ PUBLIC int mini_send( call = (caller_ptr->p_misc_flags & MF_REPLY_PEND ? SENDREC : (flags & NON_BLOCKING ? SENDNB : SEND)); IPC_STATUS_ADD_CALL(dst_ptr, call); + + if (dst_ptr->p_misc_flags & MF_REPLY_PEND) + dst_ptr->p_misc_flags &= ~MF_REPLY_PEND; + RTS_UNSET(dst_ptr, RTS_RECEIVING); } else { if(flags & NON_BLOCKING) { @@ -679,7 +683,7 @@ PRIVATE int mini_receive( IPC_STATUS_ADD_CALL(caller_ptr, NOTIFY); - return(OK); + goto receive_done; } } @@ -693,7 +697,7 @@ PRIVATE int mini_receive( if (r == OK) { IPC_STATUS_ADD_CALL(caller_ptr, SENDA); - return OK; /* Got a message */ + goto receive_done; } } @@ -731,7 +735,7 @@ PRIVATE int mini_receive( *xpp = sender->p_q_link; /* remove from queue */ sender->p_q_link = NULL; - return(OK); /* report success */ + goto receive_done; } xpp = &sender->p_q_link; /* proceed to next */ } @@ -752,6 +756,11 @@ PRIVATE int mini_receive( } else { return(ENOTREADY); } + +receive_done: + if (caller_ptr->p_misc_flags & MF_REPLY_PEND) + caller_ptr->p_misc_flags &= ~MF_REPLY_PEND; + return OK; } /*===========================================================================*