win,fs: don't modify global file translation mode

The MSVC runtime provides a global variable that can be used to set the
default file translation mode so that file open calls don't need to
explicitly specify that mode.

libuv was changing that global mode to binary from its default of text.
However, libuv doesn't actually need to do that anymore, and the
application may not want the default changed under it. This change stops
libuv from modifying that global mode.

PR-URL: https://github.com/libuv/libuv/pull/2324
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Javier Blazquez 2019-07-02 12:01:29 +02:00 committed by cjihrig
parent 04a48e9ac8
commit c905e0bed8
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
4 changed files with 1 additions and 13 deletions

View File

@ -204,9 +204,6 @@ static void uv_init(void) {
/* Initialize winsock */
uv_winsock_init();
/* Initialize FS */
uv_fs_init();
/* Initialize signal stuff */
uv_signals_init();

View File

@ -137,10 +137,6 @@ const WCHAR UNC_PATH_PREFIX_LEN = 8;
static int uv__file_symlink_usermode_flag = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
void uv_fs_init(void) {
_fmode = _O_BINARY;
}
INLINE static int fs__capture_path(uv_fs_t* req, const char* path,
const char* new_path, const int copy_path) {

View File

@ -240,12 +240,6 @@ void uv_process_endgame(uv_loop_t* loop, uv_process_t* handle);
int uv_translate_sys_error(int sys_errno);
/*
* FS
*/
void uv_fs_init(void);
/*
* FS Event
*/

View File

@ -55,6 +55,7 @@ int platform_init(int argc, char **argv) {
_setmode(0, _O_BINARY);
_setmode(1, _O_BINARY);
_setmode(2, _O_BINARY);
_set_fmode(_O_BINARY);
/* Disable stdio output buffering. */
setvbuf(stdout, NULL, _IONBF, 0);