Merge "Moving junit out of core.jar and into core-junit.jar."
diff --git a/adb/usb_linux.c b/adb/usb_linux.c
index eb10118..4b5edb6 100644
--- a/adb/usb_linux.c
+++ b/adb/usb_linux.c
@@ -20,7 +20,6 @@
#include <string.h>
#include <usbhost/usbhost.h>
-#include <linux/usbdevice_fs.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
#include <linux/usb/ch9.h>
diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h
index 29b6ea3..c2387e5 100644
--- a/include/usbhost/usbhost.h
+++ b/include/usbhost/usbhost.h
@@ -126,6 +126,9 @@
/* Cancels a pending usb_endpoint_queue() operation on an endpoint. */
int usb_endpoint_cancel(struct usb_endpoint *ep);
+/* Returns the usb_device for the given endpoint */
+struct usb_device *usb_endpoint_get_device(struct usb_endpoint *ep);
+
/* Returns the endpoint address for the given endpoint */
int usb_endpoint_number(struct usb_endpoint *ep);
diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c
index d2eaf0c..3604a42 100644
--- a/libusbhost/usbhost.c
+++ b/libusbhost/usbhost.c
@@ -444,6 +444,11 @@
return ioctl(ep->dev->fd, USBDEVFS_DISCARDURB, &ep->urb);
}
+struct usb_device *usb_endpoint_get_device(struct usb_endpoint *ep)
+{
+ return ep->dev;
+}
+
int usb_endpoint_number(struct usb_endpoint *ep)
{
return ep->desc.bEndpointAddress;
diff --git a/logwrapper/logwrapper.c b/logwrapper/logwrapper.c
index f00bfbf..6466795 100644
--- a/logwrapper/logwrapper.c
+++ b/logwrapper/logwrapper.c
@@ -60,7 +60,7 @@
buffer[b] = '\0';
} else if (buffer[b] == '\n') {
buffer[b] = '\0';
- LOG(LOG_INFO, tag, &buffer[a]);
+ LOG(LOG_INFO, tag, "%s", &buffer[a]);
a = b + 1;
}
}
@@ -68,7 +68,7 @@
if (a == 0 && b == sizeof(buffer) - 1) {
// buffer is full, flush
buffer[b] = '\0';
- LOG(LOG_INFO, tag, &buffer[a]);
+ LOG(LOG_INFO, tag, "%s", &buffer[a]);
b = 0;
} else if (a != b) {
// Keep left-overs
@@ -84,7 +84,7 @@
// Flush remaining data
if (a != b) {
buffer[b] = '\0';
- LOG(LOG_INFO, tag, &buffer[a]);
+ LOG(LOG_INFO, tag, "%s", &buffer[a]);
}
status = 0xAAAA;
if (wait(&status) != -1) { // Wait for child