aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mingw.h3
-rw-r--r--libbb/mingw.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h
index eae6a7d3a..763606e51 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -141,6 +141,9 @@ int link(const char *oldpath, const char *newpath);
141int mingw_open (const char *filename, int oflags, ...); 141int mingw_open (const char *filename, int oflags, ...);
142#define open mingw_open 142#define open mingw_open
143 143
144FILE* mingw_fopen (const char *filename, const char *mode);
145#define fopen mingw_fopen
146
144int mingw_close (int fd); 147int mingw_close (int fd);
145#define close mingw_close 148#define close mingw_close
146 149
diff --git a/libbb/mingw.c b/libbb/mingw.c
index eb239bbd6..62aad5d7e 100644
--- a/libbb/mingw.c
+++ b/libbb/mingw.c
@@ -150,6 +150,14 @@ int mingw_open (const char *filename, int oflags, ...)
150 return fd; 150 return fd;
151} 151}
152 152
153#undef fopen
154FILE *mingw_fopen (const char *filename, const char *mode)
155{
156 if (!strcmp(filename, "/dev/null"))
157 filename = "nul";
158 return fopen(filename, mode);
159}
160
153#undef close 161#undef close
154int mingw_close (int fd) 162int mingw_close (int fd)
155{ 163{