Skip to content

Commit

Permalink
parse: do not ask to run as root if not needed
Browse files Browse the repository at this point in the history
On macOS it is expected to get the error:
 idVendor:  0x0B05  Can't get iManufacturer string: LIBUSB_ERROR_INVALID_PARAM
 idProduct: 0x1825  Can't get iProduct string: LIBUSB_ERROR_INVALID_PARAM

Running as root does not solve the problem. So need to fail and ask to
re-run as root in that case.
  • Loading branch information
LudovicRousseau committed Sep 11, 2023
1 parent fe72a2e commit 8b60004
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int main(int argc, char *argv[])
{
(void)fprintf(stderr, " Can't get iManufacturer string: %s\n",
libusb_error_name(r));
if (getuid())
if (r != LIBUSB_ERROR_INVALID_PARAM && getuid())
{
(void)fprintf(stderr,
BRIGHT_RED "Please, restart the command as root\n" NORMAL);
Expand Down

0 comments on commit 8b60004

Please sign in to comment.