X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmountlist.c;h=aaf28ea79cad651750b5225fb04b963ee188b982;hb=95ed01883016323b7476f3ee580149ea4b810e0f;hp=947fb7ed27889abf471630f9c5f7e166dae28301;hpb=1032082dca7d73491e8f6d72a95eae8d501ba791;p=gnulib.git diff --git a/lib/mountlist.c b/lib/mountlist.c index 947fb7ed2..aaf28ea79 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -15,6 +15,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifdef HAVE_CONFIG_H +#if defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif + #include #include #include "mountlist.h" @@ -82,6 +93,12 @@ void error (); #include #endif +#ifdef DOLPHIN +/* So special that it's not worth putting this in autoconf. */ +#undef MOUNTED_FREAD_FSTYP +#define MOUNTED_GETMNTTBL +#endif + #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ /* Return the value of the hexadecimal number represented by CP. No prefix (like '0x') or suffix (like 'h') is expected to be @@ -92,7 +109,7 @@ xatoi (cp) char *cp; { int val; - + val = 0; while (*cp) { @@ -358,6 +375,26 @@ read_filesystem_list (need_fs_type, all_fs) } #endif /* MOUNTED_FREAD || MOUNTED_FREAD_FSTYP. */ +#ifdef MOUNTED_GETMNTTBL /* DolphinOS goes it's own way */ + { + struct mntent **mnttbl=getmnttbl(),**ent; + for (ent=mnttbl;*ent;ent++) + { + me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry)); + me->me_devname = xstrdup ( (*ent)->mt_resource); + me->me_mountdir = xstrdup( (*ent)->mt_directory); + me->me_type = xstrdup ((*ent)->mt_fstype); + me->me_dev = -1; /* Magic; means not known yet. */ + me->me_next = NULL; + + /* Add to the linked list. */ + mtail->me_next = me; + mtail = me; + } + endmnttbl(); + } +#endif + #ifdef MOUNTED_GETMNTENT2 /* SVR4. */ { struct mnttab mnt; @@ -422,7 +459,7 @@ read_filesystem_list (need_fs_type, all_fs) } else { - me->me_devname = xstrdup (thisent + + me->me_devname = xstrdup (thisent + vmp->vmt_data[VMT_OBJECT].vmt_off); } me->me_mountdir = xstrdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off);