This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
USB host support update
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Wed, 13 Aug 2008 22:56:08 +0100
- Subject: USB host support update
Eliminate a warning and sort out builds on current Linux systems.
Bart
2008-08-13 Bart Veer <bartv@ecoscentric.com>
* host/usbhost.c: insist on the GNU version of strerror_r().
Use the right header file for current Linux systems.
* host/usbchmod.c: avoid compiler warning.
Index: host/usbchmod.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/host/usbchmod.c,v
retrieving revision 1.2
diff -u -p -r1.2 usbchmod.c
--- host/usbchmod.c 7 May 2006 19:50:35 -0000 1.2
+++ host/usbchmod.c 13 Aug 2008 21:55:29 -0000
@@ -115,7 +115,8 @@ int
main(int argc, char** argv)
{
int bus, dev;
- int actual_bus, actual_dev;
+ int actual_bus = 0;
+ int actual_dev = 0;
char devname[_POSIX_PATH_MAX];
long strtol_tmp1;
char* strtol_tmp2;
Index: host/usbhost.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/host/usbhost.c,v
retrieving revision 1.4
diff -u -p -r1.4 usbhost.c
--- host/usbhost.c 7 May 2006 19:50:35 -0000 1.4
+++ host/usbhost.c 13 Aug 2008 21:55:44 -0000
@@ -67,6 +67,8 @@
/*}}}*/
/*{{{ #include's */
+// To get the desired version of strerror_r()
+#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -84,7 +86,7 @@
// Avoid compatibility problems with Tcl 8.4 vs. earlier
#define USE_NON_CONST
#include <tcl.h>
-#include <linux/usb.h>
+#include <linux/usb/ch9.h>
#include <linux/usbdevice_fs.h>
#include "../tests/protocol.h"
#include "config.h"