aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/msg.c')
-rw-r--r--ipc/msg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 32e9bd837cde..e3e52ce01123 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -763,7 +763,10 @@ static inline int convert_mode(long *msgtyp, int msgflg)
763 if (*msgtyp == 0) 763 if (*msgtyp == 0)
764 return SEARCH_ANY; 764 return SEARCH_ANY;
765 if (*msgtyp < 0) { 765 if (*msgtyp < 0) {
766 *msgtyp = -*msgtyp; 766 if (*msgtyp == LONG_MIN) /* -LONG_MIN is undefined */
767 *msgtyp = LONG_MAX;
768 else
769 *msgtyp = -*msgtyp;
767 return SEARCH_LESSEQUAL; 770 return SEARCH_LESSEQUAL;
768 } 771 }
769 if (msgflg & MSG_EXCEPT) 772 if (msgflg & MSG_EXCEPT)