diff --git a/tools/hidpp10-dump-page.c b/tools/hidpp10-dump-page.c index 5d27659a..f059b291 100644 --- a/tools/hidpp10-dump-page.c +++ b/tools/hidpp10-dump-page.c @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -94,8 +93,10 @@ main(int argc, char **argv) path = argv[argc - 1]; fd = open(path, O_RDWR); - if (fd < 0) - error(1, errno, "Failed to open path %s", path); + if (fd < 0) { + fprintf(stderr, "Failed to open path '%s': %s", path, strerror(errno)); + exit(3); + } hidpp_device_init(&base, fd); rc = hidpp10_device_new(&base, HIDPP_WIRED_DEVICE_IDX, HIDPP10_PROFILE_UNKNOWN, 5, &dev); diff --git a/tools/hidpp20-dump-page.c b/tools/hidpp20-dump-page.c index 76ccd3d1..d1ffc7d1 100644 --- a/tools/hidpp20-dump-page.c +++ b/tools/hidpp20-dump-page.c @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -111,13 +110,17 @@ main(int argc, char **argv) path = argv[argc - 1]; fd = open(path, O_RDWR); - if (fd < 0) - error(1, errno, "Failed to open path %s", path); + if (fd < 0) { + fprintf(stderr, "Failed to open path '%s': %s", path, strerror(errno)); + exit(3); + } hidpp_device_init(&base, fd); dev = hidpp20_device_new(&base, 0xff, NULL, 0); - if (!dev) - error(1, 0, "Failed to open %s as a HID++ 2.0 device", path); + if (!dev) { + fprintf(stderr, "Failed to open %s as a HID++ 2.0 device", path); + exit(3); + } hidpp20_onboard_profiles_get_profiles_desc(dev, &info); diff --git a/tools/hidpp20-reset.c b/tools/hidpp20-reset.c index f31f11e3..bb944e83 100644 --- a/tools/hidpp20-reset.c +++ b/tools/hidpp20-reset.c @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -87,13 +86,17 @@ main(int argc, char **argv) path = argv[argc - 1]; fd = open(path, O_RDWR); - if (fd < 0) - error(1, errno, "Failed to open path %s", path); + if (fd < 0) { + fprintf(stderr, "Failed to open path '%s': %s", path, strerror(errno)); + exit(3); + } hidpp_device_init(&base, fd); dev = hidpp20_device_new(&base, 0xff, NULL, 0); - if (!dev) - error(1, 0, "Failed to open %s as a HID++ 2.0 device", path); + if (!dev) { + fprintf(stderr, "Failed to open %s as a HID++ 2.0 device", path); + exit(3); + } hidpp20_onboard_profiles_get_profiles_desc(dev, &info);