diff options
author | Egor Duda <deo@logos-m.ru> | 2001-06-12 11:31:05 +0000 |
---|---|---|
committer | Egor Duda <deo@logos-m.ru> | 2001-06-12 11:31:05 +0000 |
commit | 4c15b7aba0e430aaa8e573a4b68568177787f5d2 (patch) | |
tree | 1b130c7c1aa1160edbe7bfd3a5720f7f76cac039 | |
parent | 25842b68c79e1ab640b133db6520a8c0a2a458e8 (diff) | |
download | newlib-4c15b7aba0e430aaa8e573a4b68568177787f5d2.zip newlib-4c15b7aba0e430aaa8e573a4b68568177787f5d2.tar.gz newlib-4c15b7aba0e430aaa8e573a4b68568177787f5d2.tar.bz2 |
* environ.cc (set_file_api_mode): New function. Move setting
of file APIs mode (OEM/ANSI) here.
(codepage_init): From here.
* winsup.h (set_file_api_mode): Declare it.
* fork.cc (fork_child): Set file APIs mode in forkee.
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/environ.cc | 21 | ||||
-rw-r--r-- | winsup/cygwin/fork.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/winsup.h | 2 |
4 files changed, 29 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0d111f2..66c8137 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2001-06-12 Egor Duda <deo@logos-m.ru> + + * environ.cc (set_file_api_mode): New function. Move setting + of file APIs mode (OEM/ANSI) here. + (codepage_init): From here. + * winsup.h (set_file_api_mode): Declare it. + * fork.cc (fork_child): Set file APIs mode in forkee. + Mon Jun 11 14:19:49 2001 Christopher Faylor <cgf@cygnus.com> * pinfo.cc: Use autoloaded ToolHelp functions throughout for Win9x. diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 793cebb..a3e1ec0 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -423,6 +423,21 @@ check_case_init (const char *buf) } } +void +set_file_api_mode (codepage_type cp) +{ + if (cp == oem_cp) + { + SetFileApisToOEM (); + debug_printf ("File APIs set to OEM"); + } + else if (cp == ansi_cp) + { + SetFileApisToANSI (); + debug_printf ("File APIs set to ANSI"); + } +} + static void codepage_init (const char *buf) { @@ -432,14 +447,12 @@ codepage_init (const char *buf) if (strcmp (buf, "oem")== 0) { current_codepage = oem_cp; - SetFileApisToOEM (); - debug_printf ("File APIs set to OEM"); + set_file_api_mode (current_codepage); } else if (strcmp (buf, "ansi")== 0) { current_codepage = ansi_cp; - SetFileApisToANSI (); - debug_printf ("File APIs set to ANSI"); + set_file_api_mode (current_codepage); } else { diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 42ce8ff..651d935 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -271,6 +271,8 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls) ((DWORD *)child_proc_info->stackbottom)[-15] = (DWORD)0; } + set_file_api_mode (current_codepage); + MALLOC_CHECK; pinfo_fixup_after_fork (); diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index 8eb8519..b725f82 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -162,6 +162,8 @@ extern HANDLE netapi32_handle; extern "C" void error_start_init (const char*); extern "C" int try_to_debug (bool waitloop = 1); +void set_file_api_mode (codepage_type); + extern int cygwin_finished_initializing; /**************************** Miscellaneous ******************************/ |