diff options
author | Christopher Faylor <me@cgf.cx> | 2008-05-24 15:59:01 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2008-05-24 15:59:01 +0000 |
commit | f524521aab47f3bfe51d6e64ea1789166c0940fe (patch) | |
tree | b44e48b5a635e4a2558fee6b5d457488cbc38a70 | |
parent | 0fd62c686d9297460a40dcf28932683276d516dc (diff) | |
download | cygnal-f524521aab47f3bfe51d6e64ea1789166c0940fe.tar.gz cygnal-f524521aab47f3bfe51d6e64ea1789166c0940fe.tar.bz2 cygnal-f524521aab47f3bfe51d6e64ea1789166c0940fe.zip |
* 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.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | 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 <me+cygwin@cgf.cx> + + * 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 <corinna@vinschen.de> * 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<char *const> (fstab); + char buf[NT_MAX_PATH]; char *got = buf; DWORD len = 0; /* Using NT_MAX_PATH-1 leaves space to append two \0. */ |