From 8bc1a9009e28f86ccb04df436ad1ccd4c4c78249 Mon Sep 17 00:00:00 2001 From: Kalle Vahlman Date: Fri, 16 Sep 2011 08:05:51 +0300 Subject: Return when we can't open the USB device Most commonly this means insufficent permissions (ie. for got to use sudo). --- riff/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- cgit v1.2.3