r2719 - trunk/src/host/dfu-util/src

laforge at sita.openmoko.org laforge at sita.openmoko.org
Fri Aug 17 09:50:27 CEST 2007


Author: laforge
Date: 2007-08-17 09:50:24 +0200 (Fri, 17 Aug 2007)
New Revision: 2719

Modified:
   trunk/src/host/dfu-util/src/sam7dfu.c
Log:
make dfu-util produce a working binary on Win32 platforms


Modified: trunk/src/host/dfu-util/src/sam7dfu.c
===================================================================
--- trunk/src/host/dfu-util/src/sam7dfu.c	2007-08-16 16:05:42 UTC (rev 2718)
+++ trunk/src/host/dfu-util/src/sam7dfu.c	2007-08-17 07:50:24 UTC (rev 2719)
@@ -15,6 +15,11 @@
 #include "dfu.h"
 #include "usb_dfu.h"
 
+/* ugly hack for Win32 */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 int sam7dfu_do_upload(struct usb_dev_handle *usb_handle, int interface, 
 		      int xfer_size, const char *fname)
 {
@@ -76,7 +81,7 @@
 	if (!buf)
 		return -ENOMEM;
 
-	fd = open(fname, O_RDONLY);
+	fd = open(fname, O_RDONLY|O_BINARY);
 	if (fd < 0) {
 		perror(fname);
 		ret = fd;





More information about the commitlog mailing list