]> granicus.if.org Git - strace/commitdiff
loop: print lo_encrypt_key_size field of struct loop_info as unsigned
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 1 Jan 2017 19:19:18 +0000 (22:19 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 4 Jan 2017 13:22:19 +0000 (13:22 +0000)
It is converted to an unsigned value in kernel (see loop_info64_from_old
in drivers/block/loop.c), so let's print it that way despite its type.

* loop.c (decode_loop_info): Print lo_encrypt_key_size as an uint32_t
value.

loop.c

diff --git a/loop.c b/loop.c
index e43fcaad84fabc7528c2a45d5e0671783c4489a9..50b9b3e4216025b14d791ad2a6dd695cdf4646a8 100644 (file)
--- a/loop.c
+++ b/loop.c
@@ -64,7 +64,12 @@ decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr)
                tprints(", lo_encrypt_type=");
                printxval(loop_crypt_type_options, info.lo_encrypt_type,
                        "LO_CRYPT_???");
-               tprintf(", lo_encrypt_key_size=%d", info.lo_encrypt_key_size);
+               /*
+                * It is converted to unsigned before use in kernel, see
+                * loop_info64_from_old in drivers/block/loop.c
+                */
+               tprintf(", lo_encrypt_key_size=%" PRIu32,
+                       (uint32_t) info.lo_encrypt_key_size);
        }
 
        tprints(", lo_flags=");