aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/msg.c')
-rw-r--r--ipc/msg.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index d608e6dde919..7ed1ef338e76 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -611,23 +611,22 @@ SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf)
611 611
612static int testmsg(struct msg_msg *msg, long type, int mode) 612static int testmsg(struct msg_msg *msg, long type, int mode)
613{ 613{
614 switch (mode) 614 switch (mode) {
615 { 615 case SEARCH_ANY:
616 case SEARCH_ANY: 616 case SEARCH_NUMBER:
617 case SEARCH_NUMBER: 617 return 1;
618 case SEARCH_LESSEQUAL:
619 if (msg->m_type <= type)
618 return 1; 620 return 1;
619 case SEARCH_LESSEQUAL: 621 break;
620 if (msg->m_type <= type) 622 case SEARCH_EQUAL:
621 return 1; 623 if (msg->m_type == type)
622 break; 624 return 1;
623 case SEARCH_EQUAL: 625 break;
624 if (msg->m_type == type) 626 case SEARCH_NOTEQUAL:
625 return 1; 627 if (msg->m_type != type)
626 break; 628 return 1;
627 case SEARCH_NOTEQUAL: 629 break;
628 if (msg->m_type != type)
629 return 1;
630 break;
631 } 630 }
632 return 0; 631 return 0;
633} 632}