projects
/
oweals
/
nmrpflash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21bc62f
)
Open firmware images in binary mode on Windows
author
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Wed, 10 Aug 2016 10:32:50 +0000
(12:32 +0200)
committer
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Wed, 10 Aug 2016 10:32:50 +0000
(12:32 +0200)
tftp.c
patch
|
blob
|
history
diff --git
a/tftp.c
b/tftp.c
index da76dc97158e75947ab2e9e23d3a9cc1862dcd62..2f65738edafa4feec9a0ed040c9262150f98ad12 100644
(file)
--- a/
tftp.c
+++ b/
tftp.c
@@
-26,6
+26,10
@@
#include <ctype.h>
#include "nmrpd.h"
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
#define TFTP_PKT_SIZE 516
static const char *opcode_names[] = {
@@
-237,7
+241,7
@@
int tftp_put(struct nmrpd_args *args)
if (!strcmp(args->file_local, "-")) {
fd = STDIN_FILENO;
} else {
- fd = open(args->file_local, O_RDONLY);
+ fd = open(args->file_local, O_RDONLY
| O_BINARY
);
if (fd < 0) {
perror("open");
ret = fd;