rktio Windows: fix truncate-file to not move file position
A call intended to restore the position was in place, but it was wrong.
This commit is contained in:
parent
8e4cecf215
commit
9e4ebd9196
|
@ -454,7 +454,9 @@
|
|||
(close-output-port o))
|
||||
(test 900 file-size tempfilename)
|
||||
(let ([o (open-output-file tempfilename #:exists 'update)])
|
||||
(file-position o 10)
|
||||
(file-truncate o 399)
|
||||
(test 10 file-position o)
|
||||
(close-output-port o))
|
||||
(test 399 file-size tempfilename)
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ rktio_ok_t rktio_set_file_size(rktio_t *rktio, rktio_fd_t *rfd, rktio_filesize_t
|
|||
} else {
|
||||
if (SetEndOfFile((HANDLE)fd)) {
|
||||
/* we assume that this works: */
|
||||
(void)SetFilePointer((HANDLE)fd, lo_w, &hi_w, FILE_BEGIN);
|
||||
(void)SetFilePointer((HANDLE)fd, old_lo_w, &old_hi_w, FILE_BEGIN);
|
||||
return 1;
|
||||
}
|
||||
get_windows_error();
|
||||
|
|
Loading…
Reference in New Issue
Block a user