From 5ab0b5cf529c3f069264b469db4aacbcb95ce760 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 25 Feb 2008 18:32:23 +0000 Subject: * dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is enabled. Replace calls to GetEnvironmentVariable by calls to GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA with NULL buffer. (cygbench): Ditto, drop local buffer. * environ.cc (getearly): Call GetEnvironmentVariableA. (environ_init): Retrieve unicode environment and convert to current codepage locally. (getwinenveq): Ditto. * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling convention. * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve required buffer length. * fork.cc (frok::child): Call GetEnvironmentVariableA. * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs. * sec_auth.cc: Ditto. * strfuncs.cc (sys_wcstombs_alloc): Fix formatting. (sys_mbstowcs): Change arguments to allow specifying a source string length. (sys_mbstowcs_alloc): Ditto. * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in calls to sys_mbstowcs. * winsup.h (sys_mbstowcs): Adjust declaration. (sys_mbstowcs_alloc): Ditto. --- winsup/cygwin/fork.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/fork.cc') diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index ca0bb35c8..730bc386c 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -197,13 +197,12 @@ frok::child (volatile char * volatile here) cygheap->user.reimpersonate (); #ifdef DEBUGGING - char c; - if (GetEnvironmentVariable ("FORKDEBUG", &c, 1)) + if (GetEnvironmentVariableA ("FORKDEBUG", NULL, 0)) try_to_debug (); char buf[80]; /* This is useful for debugging fork problems. Use gdb to attach to the pid reported here. */ - if (GetEnvironmentVariable ("CYGWIN_FORK_SLEEP", buf, sizeof (buf))) + if (GetEnvironmentVariableA ("CYGWIN_FORK_SLEEP", buf, sizeof (buf))) { small_printf ("Sleeping %d after fork, pid %u\n", atoi (buf), GetCurrentProcessId ()); Sleep (atoi (buf)); -- cgit v1.2.3