summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Drake <dan@reactivated.net>2010-06-22 18:20:23 -0500
committerPete Batard <pbatard@gmail.com>2010-07-29 11:17:35 +0100
commit68052b337173d2271a640226ceb79e6e5cd21731 (patch)
tree62e3897915ff9dbace5254d37718b9a2dfaa243e
parent1ebd8c90521c0f7559c040cd556a8d4f8ae50df1 (diff)
downloadlibusb-68052b337173d2271a640226ceb79e6e5cd21731.tar.gz
Linux: fix log message that was being unconditionally sent to stderr (#44)
This message was put in place to aid libusb-compat-0.1 users, who may run into the change that libusb-0.1 allowed you to usb_open() a device that you don't have write access to, but libusb-1.0 does not. As explained on the ticket this change is dangerous so it should go through the usual logging mechanism. I also added a similar regular log message to libusb-compat-0.1.
-rw-r--r--libusb/os/linux_usbfs.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index cf69286..e3da552 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -1055,10 +1055,9 @@ static int op_open(struct libusb_device_handle *handle)
hpriv->fd = open(filename, O_RDWR);
if (hpriv->fd < 0) {
if (errno == EACCES) {
- fprintf(stderr, "libusb couldn't open USB device %s: "
- "Permission denied.\n"
- "libusb requires write access to USB device nodes.\n",
- filename);
+ usbi_err("libusb couldn't open USB device %s: "
+ "Permission denied.", filename);
+ usbi_err("libusb requires write access to USB device nodes.");
return LIBUSB_ERROR_ACCESS;
} else if (errno == ENOENT) {
return LIBUSB_ERROR_NO_DEVICE;