From c9f4963ca6c455713ae57ac272b20d7342b86a65 Mon Sep 17 00:00:00 2001 From: wangqia Date: Thu, 11 May 2023 13:50:36 +0800 Subject: [PATCH] fix help parameter return value failed --- ...x-help-parameter-return-value-failed.patch | 55 +++++++++++++++++++ usbutils.spec | 6 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0001-fix-help-parameter-return-value-failed.patch diff --git a/0001-fix-help-parameter-return-value-failed.patch b/0001-fix-help-parameter-return-value-failed.patch new file mode 100644 index 0000000..cf73cc5 --- /dev/null +++ b/0001-fix-help-parameter-return-value-failed.patch @@ -0,0 +1,55 @@ +From 02b215c32a935da32677511cba4b2d3646ae8249 Mon Sep 17 00:00:00 2001 +From: wangqia +Date: Thu, 11 May 2023 11:46:13 +0800 +Subject: [PATCH] fix help error + +--- + lsusb.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +diff --git a/lsusb.c b/lsusb.c +index 80503e4..db71e3b 100644 +--- a/lsusb.c ++++ b/lsusb.c +@@ -3821,7 +3821,7 @@ int main(int argc, char *argv[]) + break; + } + } +- if (err || argc > optind || help) { ++ if (err || argc > optind) { + fprintf(stderr, "Usage: lsusb [options]...\n" + "List USB devices\n" + " -v, --verbose\n" +@@ -3843,7 +3843,28 @@ int main(int argc, char *argv[]) + ); + return EXIT_FAILURE; + } +- ++ if (help) { ++ fprintf(stderr, "Usage: lsusb [options]...\n" ++ "List USB devices\n" ++ " -v, --verbose\n" ++ " Increase verbosity (show descriptors)\n" ++ " -s [[bus]:][devnum]\n" ++ " Show only devices with specified device and/or\n" ++ " bus numbers (in decimal)\n" ++ " -d vendor:[product]\n" ++ " Show only devices with the specified vendor and\n" ++ " product ID numbers (in hexadecimal)\n" ++ " -D device\n" ++ " Selects which device lsusb will examine\n" ++ " -t, --tree\n" ++ " Dump the physical USB device hierarchy as a tree\n" ++ " -V, --version\n" ++ " Show version of program\n" ++ " -h, --help\n" ++ " Show usage and help\n" ++ ); ++ return EXIT_SUCCESS; ++ } + + /* by default, print names as well as numbers */ + if (names_init() < 0) +-- +2.27.0 + diff --git a/usbutils.spec b/usbutils.spec index c49e2a7..575d855 100644 --- a/usbutils.spec +++ b/usbutils.spec @@ -1,6 +1,6 @@ Name: usbutils Version: 012 -Release: 5 +Release: 6 Summary: Linux utilities for USB device License: GPLv2+ URL: http://www.linux-usb.org/ @@ -11,6 +11,7 @@ Source2: GPL-3.0.txt BuildRequires: libusbx-devel systemd-devel gcc libtool Patch1: 0001-usbmisc-initialize-string-buffer-before-reading-from.patch +Patch2: 0001-fix-help-parameter-return-value-failed.patch Requires: hwdata @@ -47,6 +48,9 @@ install -D -m 644 %{SOURCE2} %{buildroot}%{_defaultlicensedir}/%{name}/GPL-3.0.t %{_mandir}/*/* %changelog +* Thu May 11 2023 wangqia - 012-6 +- fix help parameter return value failed + * Tue Sep 28 2021 Wenchao Hao - 012-5 - Nothing but to sync master and LTS branch -- Gitee