]> granicus.if.org Git - strace/commitdiff
Consistently use MAX_ERRNO_VALUE
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 13 Feb 2018 05:05:13 +0000 (05:05 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 13 Feb 2018 05:05:13 +0000 (05:05 +0000)
* filter_qualify.c (parse_inject_token): Replace 4095
with MAX_ERRNO_VALUE.
* negated_errno.h (is_negated_errno): Likewise.  Remove redundant
comment.

filter_qualify.c
negated_errno.h

index 554536a29f19165de0e0a75910776ae0ba1052a1..e41af89e33b99d61c1a67e701a018aab2266ed52 100644 (file)
@@ -139,7 +139,7 @@ parse_inject_token(const char *const token, struct inject_opts *const fopts,
                                  " clipped to %d in compat personality",
                                  intval, (int) intval);
 
-               if ((int) intval < 0 && (int) intval >= -4095)
+               if ((int) intval < 0 && (int) intval >= -MAX_ERRNO_VALUE)
                        error_msg("Inadvertent injection of error %d is"
                                  " possible in compat personality for"
                                  " retval=%" PRI_kld,
index 9ec851b04771aa8d65a084c0b578b01aa844b6c3..01eb045e34689fca989dac2b203903e825d721a0 100644 (file)
@@ -35,8 +35,7 @@
 static inline bool
 is_negated_errno(kernel_ulong_t val)
 {
-       /* Linux kernel defines MAX_ERRNO to 4095. */
-       kernel_ulong_t max = -(kernel_long_t) 4095;
+       kernel_ulong_t max = -(kernel_long_t) MAX_ERRNO_VALUE;
 
 #ifndef current_klongsize
        if (current_klongsize < sizeof(val)) {