Commit 6cf1b31d authored by Paul van Schayck's avatar Paul van Schayck Committed by Alexandre Julliard

As last option for drive type detection we try the device node name.

parent 8922da9e
...@@ -43,6 +43,13 @@ BOOL gui_mode = TRUE; ...@@ -43,6 +43,13 @@ BOOL gui_mode = TRUE;
static long working_mask = 0; static long working_mask = 0;
#ifdef HAVE_MNTENT_H #ifdef HAVE_MNTENT_H
static DEV_NODES sDeviceNodes[] = {
{"/dev/fd", DRIVE_REMOVABLE},
{"/dev/cdrom", DRIVE_CDROM},
{"",0}
};
static char *ignored_fstypes[] = { static char *ignored_fstypes[] = {
"devpts", "devpts",
"tmpfs", "tmpfs",
...@@ -59,6 +66,20 @@ static char *ignored_mnt_dirs[] = { ...@@ -59,6 +66,20 @@ static char *ignored_mnt_dirs[] = {
NULL NULL
}; };
static int try_dev_node(char *dev)
{
const DEV_NODES *pDevNodes = sDeviceNodes;
while(pDevNodes->szNode[0])
{
if(!strncmp(dev,pDevNodes->szNode,strlen(pDevNodes->szNode)))
return pDevNodes->nType;
++pDevNodes;
}
return DRIVE_FIXED;
}
static BOOL should_ignore_fstype(char *type) static BOOL should_ignore_fstype(char *type)
{ {
char **s; char **s;
...@@ -288,11 +309,11 @@ int autodetect_drives() ...@@ -288,11 +309,11 @@ int autodetect_drives()
fclose(fstab); fclose(fstab);
return FALSE; return FALSE;
} }
WINE_TRACE("adding drive %c for %s, type %s\n", letter, ent->mnt_dir, ent->mnt_type);
strncpy(label, "Drive X", 8); strncpy(label, "Drive X", 8);
label[6] = letter; label[6] = letter;
WINE_TRACE("adding drive %c for %s, type %s with label %s\n", letter, ent->mnt_dir, ent->mnt_type,label);
if (!strcmp(ent->mnt_type, "nfs")) type = DRIVE_REMOTE; if (!strcmp(ent->mnt_type, "nfs")) type = DRIVE_REMOTE;
else if (!strcmp(ent->mnt_type, "nfs4")) type = DRIVE_REMOTE; else if (!strcmp(ent->mnt_type, "nfs4")) type = DRIVE_REMOTE;
...@@ -301,7 +322,7 @@ int autodetect_drives() ...@@ -301,7 +322,7 @@ int autodetect_drives()
else if (!strcmp(ent->mnt_type, "coda")) type = DRIVE_REMOTE; else if (!strcmp(ent->mnt_type, "coda")) type = DRIVE_REMOTE;
else if (!strcmp(ent->mnt_type, "iso9660")) type = DRIVE_CDROM; else if (!strcmp(ent->mnt_type, "iso9660")) type = DRIVE_CDROM;
else if (!strcmp(ent->mnt_type, "ramfs")) type = DRIVE_RAMDISK; else if (!strcmp(ent->mnt_type, "ramfs")) type = DRIVE_RAMDISK;
else type = DRIVE_FIXED; else type = try_dev_node(ent->mnt_fsname);
add_drive(letter, ent->mnt_dir, label, "0", type); add_drive(letter, ent->mnt_dir, label, "0", type);
......
...@@ -87,6 +87,12 @@ typedef struct ...@@ -87,6 +87,12 @@ typedef struct
int nSynchronous; int nSynchronous;
} X11DRV_DESC; } X11DRV_DESC;
typedef struct
{
char szNode[MAX_NAME_LENGTH];
int nType;
} DEV_NODES;
VERSION_DESC *getWinVersions(void); VERSION_DESC *getWinVersions(void);
VERSION_DESC *getDOSVersions(void); VERSION_DESC *getDOSVersions(void);
DLL_DESC *getDLLDefaults(void); DLL_DESC *getDLLDefaults(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment