diff options
Diffstat (limited to 'ipc/msg.c')
-rw-r--r-- | ipc/msg.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |