system-config-printer/system-config-printer-udev-sys-path.patch
Jiri Popelka cd29b7b20e BuildRequires systemd-devel instead of udev-devel
- replace udev_get_sys_path() with hard-coded "/sys"
2012-06-05 14:39:09 +02:00

46 lines
1.4 KiB
Diff

From cbacff0c9f7e3e6549c9b33a42e805a935db36e6 Mon Sep 17 00:00:00 2001
From: Jiri Popelka <jpopelka@redhat.com>
Date: Tue, 5 Jun 2012 14:28:36 +0200
Subject: [PATCH] udev: replace udev_get_sys_path() with hard-coded "/sys"
(trac #223)
udev_get_sys_path() is no longer provided by libudev
---
udev/udev-configure-printer.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/udev/udev-configure-printer.c b/udev/udev-configure-printer.c
index 1d89f9a..8d349e4 100644
--- a/udev/udev-configure-printer.c
+++ b/udev/udev-configure-printer.c
@@ -451,7 +451,6 @@ device_id_from_devpath (const char *devpath,
struct usb_uri_map_entry *entry;
struct udev *udev;
struct udev_device *dev, *parent_dev = NULL;
- const char *sys;
const char *idVendorStr, *idProductStr, *serial;
char *end;
unsigned long idVendor, idProduct;
@@ -500,8 +499,7 @@ device_id_from_devpath (const char *devpath,
*dest = '\0';
}
- sys = udev_get_sys_path (udev);
- syslen = strlen (sys);
+ syslen = strlen ("/sys");
devpathlen = strlen (devpath);
syspath = malloc (syslen + devpathlen + 1);
if (syspath == NULL)
@@ -511,7 +509,7 @@ device_id_from_devpath (const char *devpath,
exit (1);
}
- memcpy (syspath, sys, syslen);
+ memcpy (syspath, "/sys", syslen);
memcpy (syspath + syslen, devpath, devpathlen);
syspath[syslen + devpathlen] = '\0';
--
1.7.10.2