mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-03-02 13:05:42 +08:00
* 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.
This commit is contained in:
parent
72a90d496d
commit
db27ea4125
@ -1,3 +1,11 @@
|
|||||||
|
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>
|
2005-03-29 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_process.cc: Re-add exename.
|
* fhandler_process.cc: Re-add exename.
|
||||||
|
@ -2478,7 +2478,7 @@ cygwin_umount (const char *path, unsigned flags)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
bool
|
||||||
is_floppy (const char *dos)
|
is_floppy (const char *dos)
|
||||||
{
|
{
|
||||||
char dev[256];
|
char dev[256];
|
||||||
|
@ -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)));
|
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 */
|
/* FIXME: Move to own include file eventually */
|
||||||
|
|
||||||
#define MAX_ETC_FILES 2
|
#define MAX_ETC_FILES 2
|
||||||
|
@ -954,6 +954,15 @@ sync ()
|
|||||||
else
|
else
|
||||||
debug_printf ("Try volume %s", vol);
|
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. */
|
/* Eliminate trailing backslash. */
|
||||||
vol[strlen (vol) - 1] = '\0';
|
vol[strlen (vol) - 1] = '\0';
|
||||||
sync_worker (vol);
|
sync_worker (vol);
|
||||||
@ -964,10 +973,13 @@ sync ()
|
|||||||
}
|
}
|
||||||
else if (wincap.is_winnt ()) /* 9x has no concept for opening volumes */
|
else if (wincap.is_winnt ()) /* 9x has no concept for opening volumes */
|
||||||
{
|
{
|
||||||
extern FILE *setmntent (const char *, const char *);
|
DWORD drives = GetLogicalDrives ();
|
||||||
setmntent ("", "");
|
|
||||||
DWORD drives = _my_tls.locals.available_drives;
|
|
||||||
DWORD mask = 1;
|
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:");
|
strcpy (vol, "\\\\.\\A:");
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user