diff --git a/slirp/slirp.h b/slirp/slirp.h index 964d5e19b7fa965ab8452fe71a5a868e121f4452..fb55ad9c32f8238d628045994fe7d08a261fa2af 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -33,6 +33,7 @@ typedef char *caddr_t; #else # define ioctlsocket ioctl # define closesocket(s) close(s) +# define O_BINARY 0 #endif #include diff --git a/slirp/tftp.c b/slirp/tftp.c index 90526625c019dcdf8eab00058a462f3096f3ad07..c9946d6bf2111bc5c72d55e33f47a7f706e40561 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -103,7 +103,7 @@ static int tftp_read_data(struct tftp_session *spt, u_int16_t block_nr, int fd; int bytes_read = 0; - fd = open(spt->filename, O_RDONLY); + fd = open(spt->filename, O_RDONLY | O_BINARY); if (fd < 0) { return -1;