summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2021-10-12 10:24:03 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2021-10-12 10:27:32 +0200
commit72edb57bbaf805e76f6ea5f2d1b1702d34d441fc (patch)
tree7fad50fbde8d73be92a5d45a08c95f2ac56b54d7
parentbdbb9958228d3645601de6d417a49e5b4a01e44a (diff)
downloadstrace-72edb57bbaf805e76f6ea5f2d1b1702d34d441fc.tar.gz
ioctl: fix printing of ioctl numbers in -Xverbose mode
When NULL is passed as dflt to printflags, nothing is printed at all if flags is 0. (Ab)use the fact that comment printing is not triggered for an empty string and pass "" instead of NULL. * src/ioctl.c (ioctl_print_code, evdev_decode_number, evdev_decode_number): Pass "" as dflt instead of NULL if abbrev is false. Fixes: v5.3~10 "ioctl: do not print comments twice in -Xverbose"
-rw-r--r--src/ioctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ioctl.c b/src/ioctl.c
index 7e188246d..f32ae9761 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -78,7 +78,7 @@ ioctl_print_code(const unsigned int code)
tprints_arg_begin("_IOC");
- printflags_ex(_IOC_DIR(code), abbrev ? "_IOC_???" : NULL,
+ printflags_ex(_IOC_DIR(code), abbrev ? "_IOC_???" : "",
abbrev ? XLAT_STYLE_DEFAULT : XLAT_STYLE_ABBREV,
ioctl_dirs, NULL);
tprint_arg_next();
@@ -103,7 +103,7 @@ evdev_decode_number(const unsigned int code)
if (nr >= 0xc0 && nr <= 0xc0 + 0x3f) {
tprints_arg_begin("EVIOCSABS");
printxval_ex(evdev_abs, nr - 0xc0,
- abbrev ? "ABS_???" : NULL,
+ abbrev ? "ABS_???" : "",
abbrev ? XLAT_STYLE_DEFAULT
: XLAT_STYLE_ABBREV);
tprint_arg_end();
@@ -120,7 +120,7 @@ evdev_decode_number(const unsigned int code)
PRINT_VAL_U(0);
else
printxval_ex(evdev_ev, nr - 0x20,
- abbrev ? "EV_???" : NULL,
+ abbrev ? "EV_???" : "",
abbrev ? XLAT_STYLE_DEFAULT
: XLAT_STYLE_ABBREV);
tprint_arg_next();
@@ -129,7 +129,7 @@ evdev_decode_number(const unsigned int code)
return 1;
} else if (nr >= 0x40 && nr <= 0x40 + 0x3f) {
tprints_arg_begin("EVIOCGABS");
- printxval_ex(evdev_abs, nr - 0x40, abbrev ? "ABS_???" : NULL,
+ printxval_ex(evdev_abs, nr - 0x40, abbrev ? "ABS_???" : "",
abbrev ? XLAT_STYLE_DEFAULT : XLAT_STYLE_ABBREV);
tprint_arg_end();
return 1;