Skip to content

Commit ff045af

Browse files
jaakkor2vtjnash
authored andcommitted
ios: Use _chsize_s on Windows for file truncation (#24616)
Should allow files >2 GB to be truncated on Windows. Fix #24466 Checking Windows 32bit build https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6.1-win32.exe, libgit2.dll already uses `_chsize_s`, so both 32bit and 64bit should be able to use `_chsize_s`.
1 parent 8a6a18d commit ff045af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/support/ios.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ int ios_trunc(ios_t *s, size_t size)
566566
#if !defined(_OS_WINDOWS_)
567567
if (ftruncate(s->fd, size) == 0)
568568
#else
569-
if (_chsize(s->fd, size) == 0)
569+
if (_chsize_s(s->fd, size) == 0)
570570
#endif
571571
return 0;
572572
}

0 commit comments

Comments
 (0)