From 38b295569fab7981ed677d5ccc25d0ff7e715ad0 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 5 Feb 2015 18:04:36 +0000 Subject: [PATCH] x32: rename is_negated_errno_x32 to is_negated_errno Use the same function name on all architectures. * syscall.c [X32] (is_negated_errno_x32): Rename to is_negated_errno. (get_error) [X32]: Update callers. --- syscall.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/syscall.c b/syscall.c index 78f8f15c..33791f01 100644 --- a/syscall.c +++ b/syscall.c @@ -2219,6 +2219,7 @@ syscall_fixup_on_sysexit(struct tcb *tcp) * Check the syscall return value register value for whether it is * a negated errno code indicating an error, or a success return value. */ +#ifndef X32 static inline int is_negated_errno(unsigned long int val) { @@ -2232,9 +2233,10 @@ is_negated_errno(unsigned long int val) return val > max; } -#if defined(X32) +#else /* X32 */ + static inline int -is_negated_errno_x32(unsigned long long val) +is_negated_errno(unsigned long long val) { unsigned long long max = -(long long) nerrnos; /* @@ -2248,7 +2250,7 @@ is_negated_errno_x32(unsigned long long val) } return val > max; } -#endif +#endif /* X32 */ /* Returns: * 1: ok, continue in trace_syscall_exiting(). @@ -2305,8 +2307,7 @@ get_error(struct tcb *tcp) } else { rax = x86_64_regs.rax; } - /* Careful: is_negated_errno() works only on longs */ - if (check_errno && is_negated_errno_x32(rax)) { + if (check_errno && is_negated_errno(rax)) { tcp->u_rval = -1; u_error = -rax; } -- 2.50.1