diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-03-29 21:42:50 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-03-29 21:42:50 +0400 |
commit | db27ea412581b5618a0f8f0a6ce7014b59feb4e8 (patch) | |
tree | 97c8762c159418d399d3426e672ce4150e1ff5e1 | |
parent | 72a90d496de83734a05b452474fefdf37385aa63 (diff) |
* path.cc (is_floppy): Make externally available.
* path.h (is_floppy): Declare.
* syscalls.cc (sync): Check for floppies on A: and B: in guid case.
Don't call setmntent in non-guid case but evaluate drive bit mask
locally.
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/path.h | 2 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 18 |
4 files changed, 26 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 68a1a28c8..22814279b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,13 @@ 2005-03-29 Corinna Vinschen <corinna@vinschen.de> + * path.cc (is_floppy): Make externally available. + * path.h (is_floppy): Declare. + * syscalls.cc (sync): Check for floppies on A: and B: in guid case. + Don't call setmntent in non-guid case but evaluate drive bit mask + locally. + +2005-03-29 Corinna Vinschen <corinna@vinschen.de> + * fhandler_process.cc: Re-add exename. 2005-03-28 Christopher Faylor <cgf@timesys.com> diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 5276796df..62227e671 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2478,7 +2478,7 @@ cygwin_umount (const char *path, unsigned flags) return res; } -static bool +bool is_floppy (const char *dos) { char dev[256]; diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index e0a565fc1..bc3e2cc17 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -274,6 +274,8 @@ bool fnunmunge (char *, const char *) __attribute__ ((regparm (2))); int path_prefix_p (const char *path1, const char *path2, int len1) __attribute__ ((regparm (3))); +bool is_floppy (const char *); + /* FIXME: Move to own include file eventually */ #define MAX_ETC_FILES 2 diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index b2375e650..7cca8b610 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -954,6 +954,15 @@ sync () else debug_printf ("Try volume %s", vol); + /* Check pvol for being a floppy on A: or B:. Skip them. */ + if (strncasematch (pvol, "A:", 2) + || strncasematch (pvol, "B:", 2)) + { + pvol[2] = '\0'; + if (is_floppy (pvol)) + continue; + } + /* Eliminate trailing backslash. */ vol[strlen (vol) - 1] = '\0'; sync_worker (vol); @@ -964,10 +973,13 @@ sync () } else if (wincap.is_winnt ()) /* 9x has no concept for opening volumes */ { - extern FILE *setmntent (const char *, const char *); - setmntent ("", ""); - DWORD drives = _my_tls.locals.available_drives; + DWORD drives = GetLogicalDrives (); DWORD mask = 1; + /* Skip floppies on A: and B: as in setmntent. */ + if ((drives & 1) && is_floppy ("A:")) + drives &= ~1; + if ((drives & 2) && is_floppy ("B:")) + drives &= ~2; strcpy (vol, "\\\\.\\A:"); do { |