diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-03-29 17:42:50 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-03-29 17:42:50 +0000 |
commit | db27ea412581b5618a0f8f0a6ce7014b59feb4e8 (patch) | |
tree | 97c8762c159418d399d3426e672ce4150e1ff5e1 /winsup/cygwin/syscalls.cc | |
parent | 72a90d496de83734a05b452474fefdf37385aa63 (diff) | |
download | cygnal-db27ea412581b5618a0f8f0a6ce7014b59feb4e8.tar.gz cygnal-db27ea412581b5618a0f8f0a6ce7014b59feb4e8.tar.bz2 cygnal-db27ea412581b5618a0f8f0a6ce7014b59feb4e8.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 18 |
1 files changed, 15 insertions, 3 deletions
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 { |