summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/shared.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-11-06 13:06:36 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-11-06 13:06:36 +0000
commit74ad9cc012c738e127ad5dc52006e4e52508ab7c (patch)
tree8b68443d8caf9d4903f4809019cbd84247f2287c /winsup/cygwin/shared.cc
parent73db6db783606e4d05a3760a7a8344a6eeaca173 (diff)
downloadcygnal-74ad9cc012c738e127ad5dc52006e4e52508ab7c.tar.gz
cygnal-74ad9cc012c738e127ad5dc52006e4e52508ab7c.tar.bz2
cygnal-74ad9cc012c738e127ad5dc52006e4e52508ab7c.zip
* shared.cc (inst_root_inited): New static bool variable.
(init_installation_root): Set inst_root_inited to true. (memory_init): Print installation root debug output only if inst_root_inited is true.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r--winsup/cygwin/shared.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index ed3021cab..019636696 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -37,6 +37,7 @@ HANDLE NO_COPY cygwin_user_h;
WCHAR installation_root[PATH_MAX] __attribute__((section (".cygwin_dll_common"), shared));
UNICODE_STRING installation_key __attribute__((section (".cygwin_dll_common"), shared));
WCHAR installation_key_buf[18] __attribute__((section (".cygwin_dll_common"), shared));
+static bool inst_root_inited;
/* Use absolute path of cygwin1.dll to derive the Win32 dir which
is our installation_root. Note that we can't handle Cygwin installation
@@ -114,6 +115,8 @@ init_installation_root ()
installation_key.Length = 0;
installation_key.Buffer[0] = L'\0';
}
+
+ inst_root_inited = true;
}
/* This function returns a handle to the top-level directory in the global
@@ -432,8 +435,9 @@ memory_init (bool init_cygheap)
/* Defer debug output printing the installation root and installation key
up to this point. Debug output except for system_printf requires
the global shared memory to exist. */
- debug_printf ("Installation root: <%W> key: <%S>",
- installation_root, &installation_key);
+ if (inst_root_inited)
+ debug_printf ("Installation root: <%W> key: <%S>",
+ installation_root, &installation_key);
cygwin_shared->initialize ();
user_shared_create (false);
}