]> granicus.if.org Git - strace/commitdiff
clone: fix print_tls_arg on x86
authorEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 3 Sep 2019 11:55:53 +0000 (13:55 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 3 Sep 2019 11:58:40 +0000 (13:58 +0200)
When strace is built for (32-bit) x86, it has HAVE_STRUCT_USER_DESC
and SUPPORTED_PERSONALITIES == 1, which led to execution of the both
branches.  Simplify the logic by including the SUPPORTED_PERSONALITIES
into the condition.

* clone.c (print_tls_arg): Include SUPPORTED_PERSONALITIES into the "if"
condition.

clone.c

diff --git a/clone.c b/clone.c
index 91d515de4344eadd02c85a34854c9eb0c4a99a73..7270cee946ed209a21c041bd32ff324be609c958 100644 (file)
--- a/clone.c
+++ b/clone.c
@@ -60,15 +60,11 @@ static void
 print_tls_arg(struct tcb *const tcp, const kernel_ulong_t addr)
 {
 #ifdef HAVE_STRUCT_USER_DESC
-# if SUPPORTED_PERSONALITIES > 1
-       if (current_personality == 1)
-# endif
+       if ((SUPPORTED_PERSONALITIES == 1) || (current_personality == 1))
        {
                print_user_desc(tcp, addr, USER_DESC_BOTH);
        }
-# if SUPPORTED_PERSONALITIES > 1
        else
-# endif
 #endif /* HAVE_STRUCT_USER_DESC */
        {
                printaddr(addr);