usbutils/0003-lsusb-h-fixups.patch
Hongtao Zhang 6c7009a91b Fix lsusb -h returns an error
(cherry picked from commit d98f7442215204743af54f6450d5947de3b0188b)
2023-06-25 21:52:33 +08:00

33 lines
780 B
Diff

From 09af21c154cf7b239f39644d1245d2191abf2c76 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Sun, 25 Jun 2023 09:47:50 +0200
Subject: [PATCH 2/2] lsusb -h fixups
Previous change to make `lsusb -h` not return an error forgot to account
that the help is also printed when an invalid option is used.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lsusb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lsusb.c b/lsusb.c
index 3cb61b7..7fa1555 100644
--- a/lsusb.c
+++ b/lsusb.c
@@ -3799,7 +3799,10 @@ int main(int argc, char *argv[])
" -h, --help\n"
" Show usage and help\n"
);
- return 0;
+ if (help && !err)
+ return 0;
+ else
+ return EXIT_FAILURE;
}
--
2.23.0