summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Vahlman <kalle.vahlman@movial.com>2011-09-16 08:05:51 +0300
committerKalle Vahlman <kalle.vahlman@movial.com>2011-09-16 08:05:51 +0300
commit8bc1a9009e28f86ccb04df436ad1ccd4c4c78249 (patch)
treefb5f2a957fae801418c27d84bfe47c7da4d0d53a
parentd8a122c1e6ffc72db540c838b3a526aa340020ce (diff)
Return when we can't open the USB device
Most commonly this means insufficent permissions (ie. for got to use sudo).
-rw-r--r--riff/main.cpp4
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);
}