summaryrefslogtreecommitdiff
path: root/tests/ioctl_evdev.c
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2017-01-01 21:53:48 +0300
committerDmitry V. Levin <ldv@altlinux.org>2017-01-04 13:22:19 +0000
commitb00f54e88104a6d16f8c59b4b42ef04af39ef2dc (patch)
tree8554cb8301861053cae13da8f2832dc94499d796 /tests/ioctl_evdev.c
parent7ba63db908e5aef711e6b4261e00d1cef5a912e3 (diff)
downloadstrace-b00f54e88104a6d16f8c59b4b42ef04af39ef2dc.tar.gz
ioctl: do not print explicit 0x prefix and do not specify minimum width
Specifying output width for size argument is rather misleading - it can be up to 14 bits in size. The use of explicit "0x" prefix is discouraged because 0x0 looks ugly. Usage of width specification along with alternate form flag leads to inconsistent output for 0. Let's use just plain %#x qualifiers instead. * ioctl.c (ioctl_print_code): Change printf qualifiers for ioctl command type, number and size to "%#x". * tests/ioctl.c (main): Update expected test output. * tests/ioctl_dm.c (main): Likewise. * tests/ioctl_evdev.c (main): Likewise.
Diffstat (limited to 'tests/ioctl_evdev.c')
-rw-r--r--tests/ioctl_evdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ioctl_evdev.c b/tests/ioctl_evdev.c
index aded93f08..b21a962d5 100644
--- a/tests/ioctl_evdev.c
+++ b/tests/ioctl_evdev.c
@@ -262,13 +262,13 @@ main(void)
printf("}) = -1 EBADF (%m)\n");
# endif
- ioctl(-1, _IOC(_IOC_READ, 0x45, 0x01, 0xff), lmagic);
+ ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic);
printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n",
- "_IOC(_IOC_READ, 0x45, 0x01, 0xff)", lmagic);
+ "_IOC(_IOC_READ, 0x45, 0x1, 0xff)", lmagic);
- ioctl(-1, _IOC(_IOC_WRITE, 0x45, 0x01, 0xff), lmagic);
+ ioctl(-1, _IOC(_IOC_WRITE, 0x45, 0x1, 0xff), lmagic);
printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n",
- "_IOC(_IOC_WRITE, 0x45, 0x01, 0xff)", lmagic);
+ "_IOC(_IOC_WRITE, 0x45, 0x1, 0xff)", lmagic);
ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0x45, 0xfe, 0xff), lmagic);
printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n",