void-packages/srcpkgs/libratbag/patches/fix-usage-of-error.patch

77 lines
2.0 KiB
Diff

Source: maxice8
Upstream: No, but feel free
Reason: removes usage of non-portable of error.h
--- tools/hidpp10-dump-page.c
+++ tools/hidpp10-dump-page.c
@@ -23,7 +23,7 @@
#include <config.h>
#include <errno.h>
-#include <error.h>
+#include <err.h>
#include <fcntl.h>
#include <hidpp10.h>
@@ -95,7 +95,7 @@ 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);
+ err(errno, "Failed to open path %s", path);
hidpp_device_init(&base, fd);
dev = hidpp10_device_new(&base, HIDPP_WIRED_DEVICE_IDX, HIDPP10_PROFILE_UNKNOWN, 5);
--- tools/hidpp20-dump-page.c
+++ tools/hidpp20-dump-page.c
@@ -23,7 +23,7 @@
#include <config.h>
#include <errno.h>
-#include <error.h>
+#include <err.h>
#include <fcntl.h>
#include <hidpp20.h>
@@ -112,12 +112,12 @@ 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);
+ err(errno, "Failed to open path %s", path);
hidpp_device_init(&base, fd);
dev = hidpp20_device_new(&base, 0xff);
if (!dev)
- error(1, 0, "Failed to open %s as a HID++ 2.0 device", path);
+ err(0, "Failed to open %s as a HID++ 2.0 device", path);
hidpp20_onboard_profiles_get_profiles_desc(dev, &info);
--- tools/hidpp20-reset.c
+++ tools/hidpp20-reset.c
@@ -23,7 +23,7 @@
#include <config.h>
#include <errno.h>
-#include <error.h>
+#include <err.h>
#include <fcntl.h>
#include <hidpp20.h>
@@ -88,12 +88,12 @@ 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);
+ err(errno, "Failed to open path %s", path);
hidpp_device_init(&base, fd);
dev = hidpp20_device_new(&base, 0xff);
if (!dev)
- error(1, 0, "Failed to open %s as a HID++ 2.0 device", path);
+ err(0, "Failed to open %s as a HID++ 2.0 device", path);
hidpp20_onboard_profiles_get_profiles_desc(dev, &info);