Ignore missing driver symlink (#808934)

This commit is contained in:
Lukas Nykryn 2012-04-19 10:30:11 +02:00
parent 3279803c12
commit c409919b38
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,37 @@
diff --git a/lsusb-t.c b/lsusb-t.c
index 5438704..c8ab1b9 100644
--- a/lsusb-t.c
+++ b/lsusb-t.c
@@ -330,9 +330,7 @@ static void add_usb_interface(const char *d_name)
l = snprintf(link, MY_PATH_MAX, "%s/%s/driver", sys_bus_usb_devices, d_name);
if (l > 0 && l < MY_PATH_MAX) {
l = readlink(link, link, MY_PATH_MAX);
- if (l < 0)
- perror(d_name);
- else {
+ if (l >= 0) {
if (l < MY_PATH_MAX - 1)
link[l] = '\0';
else
@@ -395,9 +393,7 @@ static void add_usb_device(const char *d_name)
l = snprintf(link, MY_PATH_MAX, "%s/%s/driver", sys_bus_usb_devices, d_name);
if (l > 0 && l < MY_PATH_MAX) {
l = readlink(link, link, MY_PATH_MAX);
- if (l < 0)
- perror(d_name);
- else {
+ if (l >= 0) {
if (l < MY_PATH_MAX - 1)
link[l] = '\0';
else
@@ -418,9 +414,7 @@ static void get_roothub_driver(struct usbbusnode *b, const char *d_name)
l = snprintf(path, MY_PATH_MAX, "%s/%s/../driver", sys_bus_usb_devices, d_name);
if (l > 0 && l < MY_PATH_MAX) {
l = readlink(path, path, MY_PATH_MAX);
- if (l < 0)
- perror(d_name);
- else {
+ if (l >= 0) {
if (l < MY_PATH_MAX - 1)
path[l] = '\0';
else

View File

@ -1,6 +1,6 @@
Name: usbutils
Version: 004
Release: 3%{?dist}
Release: 4%{?dist}
Source: http://www.kernel.org/pub/linux/utils/usb/usbutils/%{name}-%{version}.tar.gz
URL: http://www.linux-usb.org/
License: GPLv2+
@ -14,6 +14,7 @@ Conflicts: hotplug < 3:2002_01_14-2
Patch0: usbutils-003-hwdata.patch
#Path to usb.ids should be with /hwdata/
Patch1: usbutils-make-hwdata.patch
Patch2: usbutils-005-readlink.patch
%description
This package contains utilities for inspecting devices connected to a
@ -23,6 +24,7 @@ USB bus.
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
autoreconf
%build
@ -44,6 +46,9 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Apr 19 2012 Lukas Nykryn <lnykryn@redhat.com> 004-4
- Ignore missing driver symlink (#808934)
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 004-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild