From f524521aab47f3bfe51d6e64ea1789166c0940fe Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 24 May 2008 15:59:01 +0000 Subject: [PATCH] * mount.cc (mount_info::init): Revert previous change. (mount_info::from_fstab): Change system_printf to debug_printf. Just use a local NT_MAX_PATH sized temporary buffer. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/mount.cc | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c911eb634..315cd3a69 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2008-05-24 Christopher Faylor + + * mount.cc (mount_info::init): Revert previous change. + (mount_info::from_fstab): Change system_printf to debug_printf. Just + use a local NT_MAX_PATH sized temporary buffer. + 2008-05-24 Corinna Vinschen * mount.cc (mount_info::init): Recreate path when trying to read the diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index 77de8f2c3..298c00f0a 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -126,8 +126,7 @@ mount_info::init () create_root_entry (path); pathend = wcpcpy (pathend, L"\\etc\\fstab"); if (from_fstab (false, path, pathend) /* The single | is correct! */ - | from_fstab (true, path, wcpcpy (find_root_from_cygwin_dll (path), - L"\\etc\\fstab"))) + | from_fstab (true, path, pathend)) return; } @@ -925,7 +924,7 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end) sys_mbstowcs (wcpcpy (fstab_end, L".d\\"), NT_MAX_PATH - (fstab_end - fstab), cygheap->user.name ()); - system_printf ("Try to read mounts from %W", fstab); + debug_printf ("Try to read mounts from %W", fstab); HANDLE h = CreateFileW (fstab, GENERIC_READ, FILE_SHARE_READ, &sec_none_nih, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) @@ -933,7 +932,7 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end) debug_printf ("CreateFileW, %E"); return false; } - char *const buf = reinterpret_cast (fstab); + char buf[NT_MAX_PATH]; char *got = buf; DWORD len = 0; /* Using NT_MAX_PATH-1 leaves space to append two \0. */