Skip to content

Commit c9df6f4

Browse files
kusmagitster
authored andcommitted
mingw: remove mingw_write
Since 0b6806b ("xread, xwrite: limit size of IO to 8MB"), this wrapper is no longer needed, as read and write are already split into small chunks. Signed-off-by: Erik Faye-Lund <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7edc02f commit c9df6f4

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

compat/mingw.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -304,23 +304,6 @@ int mingw_open (const char *filename, int oflags, ...)
304304
return fd;
305305
}
306306

307-
#undef write
308-
ssize_t mingw_write(int fd, const void *buf, size_t count)
309-
{
310-
/*
311-
* While write() calls to a file on a local disk are translated
312-
* into WriteFile() calls with a maximum size of 64KB on Windows
313-
* XP and 256KB on Vista, no such cap is placed on writes to
314-
* files over the network on Windows XP. Unfortunately, there
315-
* seems to be a limit of 32MB-28KB on X64 and 64MB-32KB on x86;
316-
* bigger writes fail on Windows XP.
317-
* So we cap to a nice 31MB here to avoid write failures over
318-
* the net without changing the number of WriteFile() calls in
319-
* the local case.
320-
*/
321-
return write(fd, buf, min(count, 31 * 1024 * 1024));
322-
}
323-
324307
static BOOL WINAPI ctrl_ignore(DWORD type)
325308
{
326309
return TRUE;

compat/mingw.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ int mingw_rmdir(const char *path);
180180
int mingw_open (const char *filename, int oflags, ...);
181181
#define open mingw_open
182182

183-
ssize_t mingw_write(int fd, const void *buf, size_t count);
184-
#define write mingw_write
185-
186183
int mingw_fgetc(FILE *stream);
187184
#define fgetc mingw_fgetc
188185

0 commit comments

Comments
 (0)