* mount.cc (find_root_from_cygwin_dll): New function factored from from_fstab.

Avoid use of tls since it isn't necessarily initialized when cygwin1.dll is
dynamically loaded.
(mount_info::create_root_entry): Ditto.
(mount_info::init): Calculate cygwin root once.  Use create_root_entry to
record it.  Pass fstab location to from_fstab.
(mount_info::from_fstab): Move root calculation stuff elsewhere, as per above.
* shared_info.h (mount_info::from_fstab_line): Make private.
(mount_info::fstab): Ditto.  Accommodate new arguments.
This commit is contained in:
Christopher Faylor
2008-05-23 16:38:51 +00:00
parent 7cd4542873
commit e765b3c0ad
3 changed files with 74 additions and 50 deletions

View File

@@ -75,9 +75,6 @@ class mount_info
int add_item (const char *dev, const char *path, unsigned flags);
int del_item (const char *path, unsigned flags);
bool from_fstab_line (char *line, bool user);
bool from_fstab (bool user);
unsigned set_flags_from_win32_path (const char *path);
int conv_to_win32_path (const char *src_path, char *dst, device&,
unsigned *flags = NULL);
@@ -96,9 +93,12 @@ class mount_info
PUNICODE_STRING cygd);
private:
void sort ();
void mount_slash ();
void mount_info::create_root_entry (const PWCHAR root);
bool from_fstab_line (char *line, bool user);
bool from_fstab (bool user, WCHAR [], PWCHAR);
int cygdrive_win32_path (const char *src, char *dst, int& unit);
};