diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-05-24 17:32:10 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-05-24 17:32:10 +0400 |
commit | 1a5dfe8ae08e00200a081f1f1a368f1201543761 (patch) | |
tree | f8d2a363f21ae7e2833e810e0f8843ac12244fcd /winsup/cygwin/pinfo.cc | |
parent | 592989d65ce8cbaf8f0e4aa1e295e418da009f13 (diff) |
* environ.cc (win_env::add_cache): Set the Windows environment variable
using wide chars to make sure native chars don't get scrambled.
* environ.h (build_env): Fix formatting in declaration.
* pinfo.cc (pinfo::status_exit): Handle STATUS_NO_MEMORY. Explain why.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index c92cfc10a..c51902cbd 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -144,6 +144,19 @@ pinfo::status_exit (DWORD x) case STATUS_ILLEGAL_INSTRUCTION: x = SIGILL; break; + case STATUS_NO_MEMORY: + /* If the PATH environment variable is longer than about 30K and the full + Windows environment is > 32K, startup of an exec'ed process fails with + STATUS_NO_MEMORY. This happens with all Cygwin executables, as well + as, for instance, notepad, but it does not happen with CMD for some + reason. This occurs at a point where there's no return to the exec'ing + parent process, so we have to find some way to inform the user what + happened. + + FIXME: For now, just return with SIGBUS set. Maybe it's better to add + a lengthy small_printf instead. */ + x = SIGBUS; + break; default: debug_printf ("*** STATUS_%y\n", x); x = 127 << 8; |