diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-10-21 10:59:40 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-10-21 10:59:40 +0000 |
commit | a2085837506765480f73379f21702904a5ca613c (patch) | |
tree | 3cc9a54fe55f486fcd5e5bf5afdb6ca6716bb50d /winsup/utils/cygcheck.cc | |
parent | f2ee8ffeb1339166501834b7018c2e2ccc9e43ae (diff) | |
download | cygnal-a2085837506765480f73379f21702904a5ca613c.tar.gz cygnal-a2085837506765480f73379f21702904a5ca613c.tar.bz2 cygnal-a2085837506765480f73379f21702904a5ca613c.zip |
* cygcheck.cc (CYGLSA64_DLL): Remove unused macro.
(dump_sysinfo): If COMSPEC isn't set in the MSVCRT environment, set it.
Explain why.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r-- | winsup/utils/cygcheck.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 465bc7861..cc400519e 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -1,7 +1,7 @@ /* cygcheck.cc Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010, 2011, 2012, 2013 Red Hat, Inc. + 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc. This file is part of Cygwin. @@ -587,9 +587,6 @@ cygwin_info (HANDLE h) return; } -/* Special case. Don't complain about this one. */ -#define CYGLSA64_DLL "\\cyglsa64.dll" - static void dll_info (const char *path, HANDLE fh, int lvl, int recurse) { @@ -1436,6 +1433,20 @@ dump_sysinfo () DWORD obcaseinsensitive = 1; HKEY key; + /* MSVCRT popen (called by pretty_id and dump_sysinfo_services) SEGVs if + COMSPEC isn't set correctly. Simply enforce it here. Using + Get/SetEnvironmentVariable to set the dir does *not* help, btw. + Apparently MSVCRT keeps its own copy of the environment and changing + that requires to use _wputenv. */ + if (!_wgetenv (L"COMSPEC")) + { + WCHAR comspec[MAX_PATH + 17]; + wcscpy (comspec, L"COMSPEC="); + GetSystemDirectoryW (comspec + 8, MAX_PATH); + wcsncat (comspec, L"\\cmd.exe", sizeof comspec); + _wputenv (comspec); + } + printf ("\nCygwin Configuration Diagnostics\n"); time (&now); printf ("Current System Time: %s\n", ctime (&now)); |