From b677a99b34031a72dcb6fa696a28d01259abaf83 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 22 Apr 2008 14:42:05 +0000 Subject: * cygcheck.cc (dump_sysinfo): Fix multiple Cygwin DLL test. * path.cc: Fetch mount points from fstab files instead of from registry. Use adapted functions copied from Cygwin DLL. (mnt_t): Drop issys member. Define as "mnt_t" instead of "struct mnt_t" subsequently. (max_mount_entry): New variable. (unconvert_slashes): Move to earlier location in file. Make inline. (find2): Remove. (get_cygdrive0): Remove. (get_cygdrive): Remove. (skip_ws): New function. (find_ws): Ditto. (conv_fstab_spaces): Ditto. (read_flags): Ditto. (from_fstab_line): Ditto. (get_user): Ditto. (from_fstab): Ditto. (mnt_sort): Ditto. (read_mounts): Drop old registry code. Fetch "Software\Cygwin\Setup\rootdir" value from HKCU or HKLM key. Use rootdir extracted from module path as fallback. Call from_fstab for nouser and user mount points. (setmntent): Check max_mount_entry to test if read_mounts must be called. (getmntent): Use MOUNT_SYSTEM flag instead of mnt_t's issys member. --- winsup/utils/cygcheck.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'winsup/utils/cygcheck.cc') diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 4d79e3140..84ee45f9a 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -1669,6 +1669,7 @@ dump_sysinfo () if (givehelp) printf ("Looking for various Cygwin DLLs... (-v gives version info)\n"); int cygwin_dll_count = 0; + char cygdll_path[32768]; for (pathlike *pth = paths; pth->dir; pth++) { WIN32_FIND_DATA ffinfo; @@ -1686,7 +1687,11 @@ dump_sysinfo () sprintf (tmp, "%s%s", pth->dir, f); if (strcasecmp (f, "cygwin1.dll") == 0) { - cygwin_dll_count++; + if (!cygwin_dll_count) + strcpy (cygdll_path, pth->dir); + if (!cygwin_dll_count + || strcasecmp (cygdll_path, pth->dir) != 0) + cygwin_dll_count++; found_cygwin_dll = strdup (tmp); } else -- cgit v1.2.3