summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-10-31 17:52:50 +0000
committerDave Chapman <dave@dchapman.com>2007-10-31 17:52:50 +0000
commit164b8f675c49cef79ec73af0cc473a4b3172db73 (patch)
tree27dc91f9d70edb317157bd13ab7e240972da693f
parent7f79564abc7b0a7afce8c4519c69684d86d57829 (diff)
downloadrockbox-164b8f675c49cef79ec73af0cc473a4b3172db73.tar.gz
rockbox-164b8f675c49cef79ec73af0cc473a4b3172db73.zip
Use O_BINARY when reading the firmware file - for win32 compatibility
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15385 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/tcctool/tcctool.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/tcctool/tcctool.c b/utils/tcctool/tcctool.c
index 4c4ea8fedd..bda077a459 100644
--- a/utils/tcctool/tcctool.c
+++ b/utils/tcctool/tcctool.c
@@ -23,7 +23,6 @@
23 * 23 *
24 ****************************************************************************/ 24 ****************************************************************************/
25 25
26
27#include <stdio.h> 26#include <stdio.h>
28#include <inttypes.h> 27#include <inttypes.h>
29#include <usb.h> 28#include <usb.h>
@@ -37,6 +36,11 @@
37 36
38#define MAX_FIRMWARESIZE (10*1024*1024) /* Arbitrary limit (for safety) */ 37#define MAX_FIRMWARESIZE (10*1024*1024) /* Arbitrary limit (for safety) */
39 38
39/* For win32 compatibility: */
40#ifndef O_BINARY
41#define O_BINARY 0
42#endif
43
40struct device_t 44struct device_t
41{ 45{
42 char* name; 46 char* name;
@@ -281,7 +285,7 @@ int main(int argc, char* argv[])
281 } 285 }
282 286
283 printf("[INFO] Using device \"%s\"\n",devices[device].label); 287 printf("[INFO] Using device \"%s\"\n",devices[device].label);
284 fd = open(argv[3], O_RDONLY); 288 fd = open(argv[3], O_RDONLY|O_BINARY);
285 if (fd < 0) 289 if (fd < 0)
286 { 290 {
287 printf("[ERR] Could not open %s\n", argv[3]); 291 printf("[ERR] Could not open %s\n", argv[3]);