Skip to content

Commit

Permalink
ios: Use _chsize_s on Windows for file truncation (JuliaLang#24616)
Browse files Browse the repository at this point in the history
Should allow files >2 GB to be truncated on Windows.

Fix JuliaLang#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`.
  • Loading branch information
jaakkor2 authored and evetion committed Dec 12, 2017
1 parent 383133f commit f346f83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/support/ios.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ int ios_trunc(ios_t *s, size_t size)
#if !defined(_OS_WINDOWS_)
if (ftruncate(s->fd, size) == 0)
#else
if (_chsize(s->fd, size) == 0)
if (_chsize_s(s->fd, size) == 0)
#endif
return 0;
}
Expand Down

0 comments on commit f346f83

Please sign in to comment.