|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * (C) Copyright 2000-2002
|
|
|
|
|
|
+ * (C) Copyright 2000-2003
|
|
* DENX Software Engineering
|
|
* DENX Software Engineering
|
|
* Wolfgang Denk, wd@denx.de
|
|
* Wolfgang Denk, wd@denx.de
|
|
* All rights reserved.
|
|
* All rights reserved.
|
|
@@ -39,6 +39,10 @@ typedef unsigned int uint32_t;
|
|
#define htonl(a) SWAP_LONG(a)
|
|
#define htonl(a) SWAP_LONG(a)
|
|
#endif /* __WIN32__ */
|
|
#endif /* __WIN32__ */
|
|
|
|
|
|
|
|
+#ifndef O_BINARY /* should be define'd on __WIN32__ */
|
|
|
|
+#define O_BINARY 0
|
|
|
|
+#endif
|
|
|
|
+
|
|
#include <image.h>
|
|
#include <image.h>
|
|
|
|
|
|
extern int errno;
|
|
extern int errno;
|
|
@@ -265,11 +269,7 @@ NXTARG: ;
|
|
if (lflag) {
|
|
if (lflag) {
|
|
ifd = open(imagefile, O_RDONLY);
|
|
ifd = open(imagefile, O_RDONLY);
|
|
} else {
|
|
} else {
|
|
-#ifdef __WIN32__
|
|
|
|
ifd = open(imagefile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0666);
|
|
ifd = open(imagefile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0666);
|
|
-#else
|
|
|
|
- ifd = open(imagefile, O_RDWR|O_CREAT|O_TRUNC, 0666);
|
|
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (ifd < 0) {
|
|
if (ifd < 0) {
|