mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
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
This commit is contained in:
parent
7f79564abc
commit
164b8f675c
1 changed files with 6 additions and 2 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue