Fix compilation on systems which do not have <mntent.h>.

This commit is contained in:
Gerald Pfeifer 2004-11-28 14:53:03 +00:00 committed by Alexandre Julliard
parent 648994c3ef
commit 1635947fe0
1 changed files with 8 additions and 0 deletions

View File

@ -25,7 +25,9 @@
#include "winecfg.h" #include "winecfg.h"
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_MNTENT_H
#include <mntent.h> #include <mntent.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
@ -38,6 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
BOOL gui_mode = TRUE; BOOL gui_mode = TRUE;
static long working_mask = 0; static long working_mask = 0;
#ifdef HAVE_MNTENT_H
static char *ignored_fstypes[] = { static char *ignored_fstypes[] = {
"devpts", "devpts",
"tmpfs", "tmpfs",
@ -79,6 +82,7 @@ static char allocate_letter()
return letter; return letter;
} }
#endif
#define FSTAB_OPEN 1 #define FSTAB_OPEN 1
#define NO_MORE_LETTERS 2 #define NO_MORE_LETTERS 2
@ -182,8 +186,10 @@ static void ensure_drive_c_is_mapped()
int autodetect_drives() int autodetect_drives()
{ {
#ifdef HAVE_MNTENT_H
struct mntent *ent; struct mntent *ent;
FILE *fstab; FILE *fstab;
#endif
/* we want to build a list of autodetected drives, then ensure each entry /* we want to build a list of autodetected drives, then ensure each entry
exists in the users setup. so, we superimpose the autodetected drives exists in the users setup. so, we superimpose the autodetected drives
@ -196,6 +202,7 @@ int autodetect_drives()
working_mask = drive_available_mask('\0'); working_mask = drive_available_mask('\0');
#ifdef HAVE_MNTENT_H
fstab = fopen("/etc/fstab", "r"); fstab = fopen("/etc/fstab", "r");
if (!fstab) if (!fstab)
{ {
@ -243,6 +250,7 @@ int autodetect_drives()
} }
fclose(fstab); fclose(fstab);
#endif
ensure_root_is_mapped(); ensure_root_is_mapped();