From: Tomas Hruby Date: Mon, 28 Jun 2010 08:32:49 +0000 (+0000) Subject: MF_REPLY_PEND should be removed when sendrec finishes X-Git-Tag: v3.1.8~322 X-Git-Url: http://zhaoyanbai.com/repos/doc/mandoc_char.7.html?a=commitdiff_plain;h=67fa273d00d93da31dc710a3be11993dec7b08de;p=minix.git MF_REPLY_PEND should be removed when sendrec finishes --- diff --git a/kernel/proc.c b/kernel/proc.c index ab66ef98b..6d256e350 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -559,6 +559,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); #if DEBUG_DUMPIPC @@ -677,7 +681,7 @@ PRIVATE int mini_receive(struct proc * caller_ptr, IPC_STATUS_ADD_CALL(caller_ptr, NOTIFY); - return(OK); + goto receive_done; } } @@ -691,7 +695,7 @@ PRIVATE int mini_receive(struct proc * caller_ptr, if (r == OK) { IPC_STATUS_ADD_CALL(caller_ptr, SENDA); - return OK; /* Got a message */ + goto receive_done; } } @@ -733,7 +737,7 @@ PRIVATE int mini_receive(struct proc * caller_ptr, *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 */ } @@ -754,6 +758,11 @@ PRIVATE int mini_receive(struct proc * caller_ptr, } else { return(ENOTREADY); } + +receive_done: + if (caller_ptr->p_misc_flags & MF_REPLY_PEND) + caller_ptr->p_misc_flags &= ~MF_REPLY_PEND; + return OK; } /*===========================================================================*