* 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.
This commit is contained in:
		| @@ -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> | Mon Jun 11 14:19:49 2001  Christopher Faylor <cgf@cygnus.com> | ||||||
|  |  | ||||||
| 	* pinfo.cc: Use autoloaded ToolHelp functions throughout for Win9x. | 	* pinfo.cc: Use autoloaded ToolHelp functions throughout for Win9x. | ||||||
|   | |||||||
| @@ -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 | static void | ||||||
| codepage_init (const char *buf) | codepage_init (const char *buf) | ||||||
| { | { | ||||||
| @@ -432,14 +447,12 @@ codepage_init (const char *buf) | |||||||
|   if (strcmp (buf, "oem")== 0) |   if (strcmp (buf, "oem")== 0) | ||||||
|     { |     { | ||||||
|       current_codepage = oem_cp; |       current_codepage = oem_cp; | ||||||
|       SetFileApisToOEM (); |       set_file_api_mode (current_codepage); | ||||||
|       debug_printf ("File APIs set to OEM"); |  | ||||||
|     } |     } | ||||||
|   else if (strcmp (buf, "ansi")== 0) |   else if (strcmp (buf, "ansi")== 0) | ||||||
|     { |     { | ||||||
|       current_codepage = ansi_cp; |       current_codepage = ansi_cp; | ||||||
|       SetFileApisToANSI (); |       set_file_api_mode (current_codepage); | ||||||
|       debug_printf ("File APIs set to ANSI"); |  | ||||||
|     } |     } | ||||||
|   else |   else | ||||||
|     { |     { | ||||||
|   | |||||||
| @@ -271,6 +271,8 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls) | |||||||
|       ((DWORD *)child_proc_info->stackbottom)[-15] = (DWORD)0; |       ((DWORD *)child_proc_info->stackbottom)[-15] = (DWORD)0; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |   set_file_api_mode (current_codepage); | ||||||
|  |  | ||||||
|   MALLOC_CHECK; |   MALLOC_CHECK; | ||||||
|  |  | ||||||
|   pinfo_fixup_after_fork (); |   pinfo_fixup_after_fork (); | ||||||
|   | |||||||
| @@ -162,6 +162,8 @@ extern HANDLE netapi32_handle; | |||||||
| extern "C" void error_start_init (const char*); | extern "C" void error_start_init (const char*); | ||||||
| extern "C" int try_to_debug (bool waitloop = 1); | extern "C" int try_to_debug (bool waitloop = 1); | ||||||
|  |  | ||||||
|  | void set_file_api_mode (codepage_type); | ||||||
|  |  | ||||||
| extern int cygwin_finished_initializing; | extern int cygwin_finished_initializing; | ||||||
|  |  | ||||||
| /**************************** Miscellaneous ******************************/ | /**************************** Miscellaneous ******************************/ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user