diff options
author | Richard Hughes <richard@hughsie.com> | 2015-11-20 14:17:36 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-11-20 14:17:36 +0000 |
commit | 5029d349a0e06cbe2e97231d16ebe1e65e5afa56 (patch) | |
tree | 83beb09475f7913809a8236c3680e40955bb8b2d /gusb/gusb-device.c | |
parent | 2082634f9b402e55365e150042929837317ba8f3 (diff) | |
download | gusb-5029d349a0e06cbe2e97231d16ebe1e65e5afa56.tar.gz |
Add a PERMISSION_DENIED error enum
Sometimes we want to handle this differently...
Diffstat (limited to 'gusb/gusb-device.c')
-rw-r--r-- | gusb/gusb-device.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c index 155bb62..3914143 100644 --- a/gusb/gusb-device.c +++ b/gusb/gusb-device.c @@ -335,19 +335,26 @@ g_usb_device_libusb_error_to_gerror (GUsbDevice *device, case LIBUSB_ERROR_NO_MEM: case LIBUSB_ERROR_OTHER: case LIBUSB_ERROR_INTERRUPTED: - error_code = G_USB_DEVICE_ERROR_INTERNAL; break; + error_code = G_USB_DEVICE_ERROR_INTERNAL; + break; case LIBUSB_ERROR_IO: case LIBUSB_ERROR_OVERFLOW: case LIBUSB_ERROR_PIPE: - error_code = G_USB_DEVICE_ERROR_IO; break; + error_code = G_USB_DEVICE_ERROR_IO; + break; case LIBUSB_ERROR_TIMEOUT: - error_code = G_USB_DEVICE_ERROR_TIMED_OUT; break; + error_code = G_USB_DEVICE_ERROR_TIMED_OUT; + break; case LIBUSB_ERROR_NOT_SUPPORTED: - error_code = G_USB_DEVICE_ERROR_NOT_SUPPORTED; break; - case LIBUSB_ERROR_NO_DEVICE: + error_code = G_USB_DEVICE_ERROR_NOT_SUPPORTED; + break; case LIBUSB_ERROR_ACCESS: + error_code = G_USB_DEVICE_ERROR_PERMISSION_DENIED; + break; + case LIBUSB_ERROR_NO_DEVICE: case LIBUSB_ERROR_BUSY: - error_code = G_USB_DEVICE_ERROR_NO_DEVICE; break; + error_code = G_USB_DEVICE_ERROR_NO_DEVICE; + break; } g_set_error (error, G_USB_DEVICE_ERROR, error_code, |