diff options
author | Kalle Vahlman <kalle.vahlman@movial.com> | 2011-09-16 08:05:51 +0300 |
---|---|---|
committer | Kalle Vahlman <kalle.vahlman@movial.com> | 2011-09-16 08:05:51 +0300 |
commit | 8bc1a9009e28f86ccb04df436ad1ccd4c4c78249 (patch) | |
tree | fb5f2a957fae801418c27d84bfe47c7da4d0d53a /riff | |
parent | d8a122c1e6ffc72db540c838b3a526aa340020ce (diff) |
Return when we can't open the USB device
Most commonly this means insufficent permissions (ie. for got to use sudo).
Diffstat (limited to 'riff')
-rw-r--r-- | riff/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/riff/main.cpp b/riff/main.cpp index 5ce8e65..803ebe7 100644 --- a/riff/main.cpp +++ b/riff/main.cpp @@ -131,6 +131,10 @@ void UsbDeviceEventCallback(DeviceStatus_t status, DeviceEvent_t event, Device_t logger_->log(Logger::ERROR, "Unknown USB event %d", event); break; } + } else if (COMM_DEVICE_LIBUSB_FAILED_TO_OPEN_PORT == status) { + logger_->log(Logger::ERROR, "Cannot open USB device. Are you root?", status); + isDone = true; + exitstatus = 1; } else { logger_->log(Logger::ERROR, "USB device error %d", status); } |