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 854854w32_ftruncate (int fd , off_t length ) {
855855 CHECK_FD (fd );
856856
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 ))
860858 return -1 ;
861- if (!SetFilePointer (w32_fd_to_handle (fd ), 0 , 0 , FILE_BEGIN ))
859+ if (!SetEndOfFile (w32_fd_to_handle (fd )))
862860 return -1 ;
863861
864862 return 0 ;
Original file line number Diff line number Diff line change @@ -919,6 +919,11 @@ main(int argc, char **argv)
919919 extern int optind ;
920920
921921#ifdef WINDOWS
922+ /*
923+ * Initialize I/O wrappers.
924+ */
925+
926+ w32posix_initialize ();
922927 ConInit (STD_OUTPUT_HANDLE , TRUE);
923928#endif
924929
@@ -1079,7 +1084,7 @@ main(int argc, char **argv)
10791084 exit (errs != 0 );
10801085 }
10811086 if (tflag ) {
1082- /* Receive data. */
1087+ /* Receive data. */
10831088 sink (argc , argv );
10841089 exit (errs != 0 );
10851090 }
You can’t perform that action at this time.
0 commit comments