summaryrefslogtreecommitdiffstats
path: root/utils
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 /utils
parent7f79564abc7b0a7afce8c4519c69684d86d57829 (diff)
downloadrockbox-164b8f675c49cef79ec73af0cc473a4b3172db73.tar.gz
rockbox-164b8f675c49cef79ec73af0cc473a4b3172db73.tar.bz2
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
Diffstat (limited to 'utils')
-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 @@
*
****************************************************************************/
-
#include <stdio.h>
#include <inttypes.h>
#include <usb.h>
@@ -37,6 +36,11 @@
#define MAX_FIRMWARESIZE (10*1024*1024) /* Arbitrary limit (for safety) */
+/* For win32 compatibility: */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
struct device_t
{
char* name;
@@ -281,7 +285,7 @@ int main(int argc, char* argv[])
}
printf("[INFO] Using device \"%s\"\n",devices[device].label);
- fd = open(argv[3], O_RDONLY);
+ fd = open(argv[3], O_RDONLY|O_BINARY);
if (fd < 0)
{
printf("[ERR] Could not open %s\n", argv[3]);