]> granicus.if.org Git - strace/commitdiff
aio: print hexadecimal integer using %#x
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 7 Jan 2017 16:44:44 +0000 (16:44 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 7 Jan 2017 16:44:44 +0000 (16:44 +0000)
The formerly used format string %x led to misleading output as there was
no clear indication sometimes whether the printed integer was decimal or
hexadecimal.

* aio.c (print_common_flags): Print struct iocb.aio_flags using %#x
format specifier instead of %x.
* tests/aio.c (main): Likewise.

aio.c
tests/aio.c

diff --git a/aio.c b/aio.c
index 47a4038aca0765cbac29d9b264951b22bdd79e89..e246b35351ae7495de58142c3eee8d8ccaf1f985 100644 (file)
--- a/aio.c
+++ b/aio.c
@@ -87,7 +87,7 @@ print_common_flags(struct tcb *tcp, const struct iocb *cb)
                printfd(tcp, cb->aio_resfd);
        }
        if (cb->aio_flags & ~IOCB_FLAG_RESFD)
-               tprintf(", flags=%x", cb->aio_flags);
+               tprintf(", flags=%#x", cb->aio_flags);
 #endif
 }
 
index 5b0c1aaffc050461d5cd8274b6554c24f99fe326..0766d23a75d9b50b62c411edb0e319bbc9a7d322 100644 (file)
@@ -301,7 +301,7 @@ main(void)
               "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL"
                       ", nbytes=%" PRI__u64 ", offset=%" PRI__d64
 # ifdef IOCB_FLAG_RESFD
-                      ", resfd=%d, flags=%x"
+                      ", resfd=%d, flags=%#x"
 # endif
                       "}, "
               "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64