The addition of winecfg/drivedetect.c via
revision 1.1 date: 2004/11/23 13:50:23; author: julliard; state: Exp; Mike Hearn mike@navi.cx - More heapification. - Split drive code into core, UI and autodetect. - Implement drive autodetection. - Slight redesign of drive tab. - Code cleanup.
broke FreeBSD 4.10 which does not have <mntent.h>:
/sw/gcc-3.3.4/bin/gcc -c -I. -I. -I../../include -I../../include -D_REENTRANT -fPIC -Wall -pipe -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith -g -O2 -o drivedetect.o drivedetect.c drivedetect.c:28:20: mntent.h: No such file or directory
In fact, FreeBSD 4.10 does not have getmntent() at all which leads to further breakage even if you properly autoconf for <mntent.h>:
drivedetect.c:206: warning: implicit declaration of function `getmntent'
The Linux man page states
SysV also has a getmntent() function but the calling sequence differs, and the returned structure is different. Under SysV /etc/mnttab is used. BSD 4.4 and Digital Unix have a routine getmntinfo(), a wrapper around the system call getfsstat().
http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=getmntinfo has the man page for FreeBSD.
Gerald
On Wed, 24 Nov 2004, Gerald Pfeifer wrote:
The addition of winecfg/drivedetect.c via
revision 1.1 date: 2004/11/23 13:50:23; author: julliard; state: Exp; Mike Hearn mike@navi.cx
- More heapification.
- Split drive code into core, UI and autodetect.
- Implement drive autodetection.
- Slight redesign of drive tab.
- Code cleanup.
broke FreeBSD 4.10 which does not have <mntent.h>:
Fixed thusly. Please apply before the next snapshot.
Gerald
ChangeLog: Fix compilation on systems which do not have <mntent.h>. Index: drivedetect.c =================================================================== RCS file: /home/wine/wine/programs/winecfg/drivedetect.c,v retrieving revision 1.1 diff -u -3 -p -r1.1 drivedetect.c --- drivedetect.c 23 Nov 2004 13:50:23 -0000 1.1 +++ drivedetect.c 24 Nov 2004 18:15:31 -0000 @@ -25,7 +25,9 @@ #include "winecfg.h"
#include <stdio.h> +#ifdef HAVE_MNTENT_H #include <mntent.h> +#endif #include <stdlib.h> #include <errno.h>
@@ -38,6 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winecfg); BOOL gui_mode = TRUE; static long working_mask = 0;
+#ifdef HAVE_MNTENT_H static char *ignored_fstypes[] = { "devpts", "tmpfs", @@ -79,6 +82,7 @@ static char allocate_letter()
return letter; } +#endif
#define FSTAB_OPEN 1 #define NO_MORE_LETTERS 2 @@ -182,8 +186,10 @@ static void ensure_drive_c_is_mapped()
int autodetect_drives() { +#ifdef HAVE_MNTENT_H struct mntent *ent; FILE *fstab; +#endif
/* we want to build a list of autodetected drives, then ensure each entry exists in the users setup. so, we superimpose the autodetected drives @@ -196,6 +202,7 @@ int autodetect_drives()
working_mask = drive_available_mask('\0');
+#ifdef HAVE_MNTENT_H fstab = fopen("/etc/fstab", "r"); if (!fstab) { @@ -243,6 +250,7 @@ int autodetect_drives() }
fclose(fstab); +#endif
ensure_root_is_mapped();