file-truncate: flush on Windows before truncating

Otherwise, writes to the output port can get lost.
This commit is contained in:
Matthew Flatt 2015-08-24 15:06:34 -06:00
parent cbb4ffee4d
commit b9a5e92c37

View File

@ -5593,6 +5593,7 @@ Scheme_Object *scheme_file_truncate(int argc, Scheme_Object *argv[])
errid = -1;
#ifdef WINDOWS_FILE_HANDLES
flush_fd(scheme_output_port_record(argv[0]), NULL, 0, 0, 0, 0);
if (win_seekable(fd)) {
DWORD r;
LONG lo_w, hi_w, old_lo_w, old_hi_w;