File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
contrib/win32/win32compat Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 854
854
w32_ftruncate (int fd , off_t length ) {
855
855
CHECK_FD (fd );
856
856
857
- if (!SetEndOfFile (w32_fd_to_handle (fd )))
858
- return -1 ;
859
- if (!SetFileValidData (w32_fd_to_handle (fd ), length ))
857
+ if (!SetFilePointer (w32_fd_to_handle (fd ), length , 0 , FILE_BEGIN ))
860
858
return -1 ;
861
- if (!SetFilePointer (w32_fd_to_handle (fd ), 0 , 0 , FILE_BEGIN ))
859
+ if (!SetEndOfFile (w32_fd_to_handle (fd )))
862
860
return -1 ;
863
861
864
862
return 0 ;
Original file line number Diff line number Diff line change @@ -919,6 +919,11 @@ main(int argc, char **argv)
919
919
extern int optind ;
920
920
921
921
#ifdef WINDOWS
922
+ /*
923
+ * Initialize I/O wrappers.
924
+ */
925
+
926
+ w32posix_initialize ();
922
927
ConInit (STD_OUTPUT_HANDLE , TRUE);
923
928
#endif
924
929
@@ -1079,7 +1084,7 @@ main(int argc, char **argv)
1079
1084
exit (errs != 0 );
1080
1085
}
1081
1086
if (tflag ) {
1082
- /* Receive data. */
1087
+ /* Receive data. */
1083
1088
sink (argc , argv );
1084
1089
exit (errs != 0 );
1085
1090
}
You can’t perform that action at this time.
0 commit comments