]> git.wh0rd.org Git - dump.git/commitdiff
Look also in /etc/mtab for filesystems...
authorStelian Pop <stelian@popies.net>
Thu, 12 Dec 2002 11:49:35 +0000 (11:49 +0000)
committerStelian Pop <stelian@popies.net>
Thu, 12 Dec 2002 11:49:35 +0000 (11:49 +0000)
13 files changed:
CHANGES
THANKS
compat/include/fstab.h [deleted file]
compat/lib/Makefile.in
compat/lib/fstab.c [deleted file]
config.guess
config.h.in
config.sub
configure
configure.in
dump/dump.h
dump/main.c
dump/optr.c

diff --git a/CHANGES b/CHANGES
index dc98de196e49a6a4baae4984478f7f45c5ea56a4..ec6f5ef3f570e582d67b900f1e2ec0e7767a5e62 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.202 2002/12/09 10:53:59 stelian Exp $
+$Id: CHANGES,v 1.203 2002/12/12 11:49:35 stelian Exp $
 
 Changes between versions 0.4b32 and 0.4b33 (released ?????????????????)
 =======================================================================
@@ -15,6 +15,13 @@ Changes between versions 0.4b32 and 0.4b33 (released ?????????????????)
        an extra, unrelated error message). Thanks to Dragan Krnic
        <dkrnic@lycos.com> for reporting this bug.
 
+4.     Made dump look first into /etc/fstab, then into /etc/mtab 
+       when searching for filesystem paths. Also fixed some problems
+       caused by binding mounts or multiple block device mounts.
+       Thanks to Matus Uhlar <uhlar@fantomas.sk>, Elliott Mitchell
+       <ehem@m5p.com>, Greg Edwards <gedwards@users.sourceforge.net>.
+       (fixes Debian bugs #147086 and #160305, Sourceforge bug #618699)
+
 Changes between versions 0.4b31 and 0.4b32 (released November 15, 2002)
 =======================================================================
 
diff --git a/THANKS b/THANKS
index a1b8c093091b4aafd224868e7780163e3a77d8d5..00dcc8c311868e4cc065107260e632a73f7cbacb 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.71 2002/12/09 10:53:59 stelian Exp $
+$Id: THANKS,v 1.72 2002/12/12 11:49:35 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -39,6 +39,7 @@ John R. Dennison      gerdesas@users.sourceforge.net
 Eugenio Diaz           getnito@yahoo.com
 Andreas Dilger         adilger@turbolinux.com
 Andrew Donkin          ard@waikato.ac.nz
+Greg Edwards           gedwards@users.sourceforge.net
 Bernhard Erdmann       bernhard.erdmann@gmx.de
 Jason Fearon           jasonf@netrider.org.au
 Jeremy Fitzhardinge    jeremy@goop.org
@@ -102,6 +103,7 @@ Erik Troan          ewt@redhat.com
 Philippe Troin         phil@fifi.org
 Theodore Y. Ts'o       tytso@valinux.com
 Stephen Tweedie                sct@dcs.ed.ac.uk
+Matus Uhlar            uhlar@fantomas.sk
 Amith Varghese         amithv@yahoo.com
 Daniel Veillard                Daniel.Veillard@imag.fr
 Jason Venner           jason@idiom.com
diff --git a/compat/include/fstab.h b/compat/include/fstab.h
deleted file mode 100644 (file)
index 234edec..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *     Ported to Linux's Second Extended File System as part of the
- *     dump and restore backup suit
- *     Remy Card <card@Linux.EU.Org>, 1994-1997
- *     Stelian Pop <stelian@popies.net>, 1999-2000
- *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
- *
- *     $Id: fstab.h,v 1.12 2002/01/16 09:32:14 stelian Exp $
- */
-
-/*
- * Copyright (c) 1980, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _FSTAB_H_
-#define _FSTAB_H_
-
-#include <config.h>
-
-/*
- * File system table, see fstab(5).
- *
- * Used by dump, mount, umount, swapon, fsck, df, ...
- *
- * For ufs fs_spec field is the block special name.  Programs that want to
- * use the character special name must create that name by prepending a 'r'
- * after the right most slash.  Quota files are always named "quotas", so
- * if type is "rq", then use concatenation of fs_file and "quotas" to locate
- * quota file.
- */
-#ifdef __linux__
-#include <mntent.h>
-#ifdef _PATH_MNTTAB
-#define _PATH_FSTAB    _PATH_MNTTAB
-#else
-#define        _PATH_FSTAB     "/etc/fstab"
-#endif
-#endif /* __linux__ */
-#define        FSTAB           _PATH_FSTAB     /* deprecated */
-
-#define FSTAB_DEF      "defaults"      /* default mount option */
-#define        FSTAB_RW        "rw"            /* read/write device */
-#define        FSTAB_RQ        "rq"            /* read/write with quotas */
-#define        FSTAB_RO        "ro"            /* read-only device */
-#define        FSTAB_SW        "sw"            /* swap device */
-#define        FSTAB_XX        "ignore"        /* ignore totally */
-
-struct fstab {
-       const char *fs_spec;            /* block special device name */
-       char    *fs_file;               /* file system path prefix */
-       char    *fs_vfstype;            /* File system type, ufs, nfs */
-       char    *fs_mntops;             /* Mount options ala -o */
-       char    *fs_type;               /* FSTAB_* from fs_mntops */
-       int     fs_freq;                /* dump frequency, in days */
-       int     fs_passno;              /* pass number on parallel dump */
-};
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct fstab *getfsent __P((void));
-struct fstab *getfsspec __P((const char *));
-struct fstab *getfsfile __P((const char *));
-int setfsent __P((void));
-void endfsent __P((void));
-__END_DECLS
-
-#endif /* !_FSTAB_H_ */
index 843828f1b21e5da4d8e682a1a2dfff8ff9be1623..9be9243e5740548f5a6cb2ebec59ea151de673e9 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.6 2002/07/29 12:00:33 stelian Exp $
+# $Id: Makefile.in,v 1.7 2002/12/12 11:49:35 stelian Exp $
 
 top_srcdir=    @top_srcdir@
 srcdir=                @srcdir@
@@ -7,8 +7,8 @@ srcdir=         @srcdir@
 
 INC=           -I$(top_srcdir)/compat/include
 CFLAGS=                @CCOPTS@ -pipe $(OPT) $(GINC) $(INC) $(DEFS)
-SRCS=          compaterr.c fstab.c compatglob.c bylabel.c system.c rmtflags.c
-OBJS=          compaterr.o fstab.o compatglob.o bylabel.o system.o rmtflags.o
+SRCS=          compaterr.c compatglob.c bylabel.c system.c rmtflags.c
+OBJS=          compaterr.o compatglob.o bylabel.o system.o rmtflags.o
 LIB=           libcompat.a
 
 all::          $(LIB)
diff --git a/compat/lib/fstab.c b/compat/lib/fstab.c
deleted file mode 100644 (file)
index de95455..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- *     Ported to Linux's Second Extended File System as part of the
- *     dump and restore backup suit
- *     Remy Card <card@Linux.EU.Org>, 1994-1997
- *     Stelian Pop <stelian@popies.net>, 1999-2000
- *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
- */
-
-/*
- * Copyright (c) 1980, 1988, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static const char rcsid[] =
-       "$Id: fstab.c,v 1.13 2002/01/25 15:08:59 stelian Exp $";
-#endif /* not lint */
-
-#include <config.h>
-#include <errno.h>
-#include <fstab.h>
-#include <mntent.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <bylabel.h>
-
-static FILE *_fs_fp;
-static struct fstab _fs_fstab;
-
-static void error __P((int));
-static int fstabscan __P((void));
-
-void msg __P((const char *fmt, ...));
-
-static
-int fstabscan(void)
-{
-       struct mntent   *mnt;
-       char *cp;
-       int typexx;
-#define        MAXLINELENGTH   1024
-       char subline[MAXLINELENGTH];
-
-       for (;;) {
-               const char *device_name;
-               if (!(mnt = getmntent(_fs_fp)))
-                       return 0;
-
-               device_name = get_device_name(mnt->mnt_fsname);
-               if (!device_name) {
-                       msg("Warning: unable to translate %s\n", mnt->mnt_fsname);
-                       continue;
-               }
-               _fs_fstab.fs_spec = device_name;
-               _fs_fstab.fs_file = mnt->mnt_dir;
-               _fs_fstab.fs_vfstype = mnt->mnt_type;
-               _fs_fstab.fs_mntops = mnt->mnt_opts;
-               _fs_fstab.fs_type = FSTAB_RW;   /* rw by default under Linux */
-               _fs_fstab.fs_freq = mnt->mnt_freq;
-               _fs_fstab.fs_passno = mnt->mnt_passno;
-
-               strcpy(subline, _fs_fstab.fs_mntops);
-               for (typexx = 0, cp = strtok(subline, ","); cp;
-                    cp = strtok((char *)NULL, ",")) {
-                       if (!strcmp(cp, FSTAB_RW)) {
-                               _fs_fstab.fs_type = FSTAB_RW;
-                               break;
-                       }
-                       if (!strcmp(cp, FSTAB_RQ)) {
-                               _fs_fstab.fs_type = FSTAB_RQ;
-                               break;
-                       }
-                       if (!strcmp(cp, FSTAB_RO)) {
-                               _fs_fstab.fs_type = FSTAB_RO;
-                               break;
-                       }
-                       if (!strcmp(cp, FSTAB_SW)) {
-                               _fs_fstab.fs_type = FSTAB_SW;
-                               break;
-                       }
-                       if (!strcmp(cp, FSTAB_XX)) {
-                               _fs_fstab.fs_type = FSTAB_XX;
-                               typexx++;
-                               break;
-                       }
-               }
-               if (typexx)
-                       continue;
-
-               return 1;
-       }
-}
-
-struct fstab *
-getfsent(void)
-{
-       if ((!_fs_fp && !setfsent()) || !fstabscan())
-               return((struct fstab *)NULL);
-       return(&_fs_fstab);
-}
-
-struct fstab *
-getfsspec(const char *name)
-{
-       if (setfsent())
-               while (fstabscan())
-                       if (!strcmp(_fs_fstab.fs_spec, name))
-                               return(&_fs_fstab);
-       return((struct fstab *)NULL);
-}
-
-struct fstab *
-getfsfile(const char *name)
-{
-       if (setfsent())
-               while (fstabscan())
-                       if (!strcmp(_fs_fstab.fs_file, name))
-                               return(&_fs_fstab);
-       return((struct fstab *)NULL);
-}
-
-int
-setfsent(void)
-{
-       if (_fs_fp) {
-               rewind(_fs_fp);
-               return(1);
-       }
-       if ((_fs_fp = setmntent(_PATH_FSTAB, "r")))
-               return(1);
-       error(errno);
-       return(0);
-}
-
-void
-endfsent(void)
-{
-       if (_fs_fp) {
-               (void)endmntent(_fs_fp);
-               _fs_fp = NULL;
-       }
-}
-
-static
-void error(int err)
-{
-       char *p;
-
-       (void)write(STDERR_FILENO, "fstab: ", 7);
-       (void)write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1);
-       (void)write(STDERR_FILENO, ": ", 1);
-       p = strerror(err);
-       (void)write(STDERR_FILENO, p, strlen(p));
-       (void)write(STDERR_FILENO, "\n", 1);
-}
index ba661651615d361468d6b54633a37f57662f8bbe..6012b39695f4474fb96bcfef1d13938fc736f81f 100755 (executable)
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 #   Free Software Foundation, Inc.
 
-timestamp='2001-04-20'
+timestamp='2001-07-12'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -95,25 +95,25 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
 # use `HOST_CC' if defined, but it is deprecated.
 
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int dummy(){}" > $dummy.c
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int dummy(){}" > $dummy.c ;
        for c in cc gcc c89 ; do
-         ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
+         ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
          if test $? = 0 ; then
-            CC_FOR_BUILD="$c"; break
-         fi
-       done
-       rm -f $dummy.c $dummy.o $dummy.rel
+            CC_FOR_BUILD="$c"; break ;
+         fi ;
+       done ;
+       rm -f $dummy.c $dummy.o $dummy.rel ;
        if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found
+         CC_FOR_BUILD=no_compiler_found ;
        fi
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac
+esac'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
+# (ghazi@noc.rutgers.edu 1994-08-24)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
@@ -150,6 +150,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # to ELF recently, or will in the future.
        case "${UNAME_MACHINE}" in
            i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+               eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep __ELF__ >/dev/null
                then
@@ -204,6 +205,7 @@ main:
        jsr \$26,exit
        .end main
 EOF
+       eval $set_cc_for_build
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
        if test "$?" = 0 ; then
                case `./$dummy` in
@@ -406,6 +408,7 @@ EOF
          exit (-1);
        }
 EOF
+       eval $set_cc_for_build
        $CC_FOR_BUILD $dummy.c -o $dummy \
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
          && rm -f $dummy.c $dummy && exit 0
@@ -486,6 +489,7 @@ EOF
                        exit(0);
                        }
 EOF
+               eval $set_cc_for_build
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
                rm -f $dummy.c $dummy
                echo rs6000-ibm-aix3.2.5
@@ -586,6 +590,7 @@ EOF
                   exit (0);
               }
 EOF
+       eval $set_cc_for_build
        (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
        if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
        rm -f $dummy.c $dummy
@@ -623,6 +628,7 @@ EOF
          exit (0);
        }
 EOF
+       eval $set_cc_for_build
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
        rm -f $dummy.c $dummy
        echo unknown-hitachi-hiuxwe2
@@ -633,7 +639,7 @@ EOF
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
        exit 0 ;;
-    *9??*:MPE/iX:*:*)
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
        exit 0 ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
@@ -677,12 +683,13 @@ EOF
        echo xmp-cray-unicos
         exit 0 ;;
     CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE}
+       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
     CRAY*[A-Z]90:*:*:*)
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+             -e 's/\.[^.]*$/.X/'
        exit 0 ;;
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
@@ -763,97 +770,26 @@ EOF
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit 0 ;;
     mips:Linux:*:*)
-       cat >$dummy.c <<EOF
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-int main (int argc, char *argv[]) {
-#else
-int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __MIPSEB__
-  printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
-  printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
-  return 0;
-}
-EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
+         big)    echo mips-unknown-linux-gnu && exit 0 ;;
+         little) echo mipsel-unknown-linux-gnu && exit 0 ;;
+       esac
        ;;
     ppc:Linux:*:*)
-       # Determine Lib Version
-       cat >$dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#if defined(__GLIBC__)
-  printf("%s %s\n", __libc_version, __libc_release);
-#else
-  printf("unknown\n");
-#endif
-  return 0;
-}
-EOF
-       LIBC=""
-       $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
-       if test "$?" = 0 ; then
-               ./$dummy | grep 1\.99 > /dev/null
-               if test "$?" = 0 ; then LIBC="libc1" ; fi
-       fi
-       rm -f $dummy.c $dummy
-       echo powerpc-unknown-linux-gnu${LIBC}
+       echo powerpc-unknown-linux-gnu
        exit 0 ;;
     alpha:Linux:*:*)
-       cat <<EOF >$dummy.s
-         .data
-         \$Lformat:
-               .byte 37,100,45,37,120,10,0     # "%d-%x\n"
-          .text
-               .globl main
-               .align 4
-               .ent main
-           main:
-               .frame \$30,16,\$26,0
-               ldgp \$29,0(\$27)
-               .prologue 1
-               .long 0x47e03d80 # implver \$0
-               lda \$2,-1
-               .long 0x47e20c21 # amask \$2,\$1
-               lda \$16,\$Lformat
-               mov \$0,\$17
-               not \$1,\$18
-               jsr \$26,printf
-               ldgp \$29,0(\$26)
-               mov 0,\$16
-               jsr \$26,exit
-               .end main
-EOF
-       LIBC=""
-       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-       if test "$?" = 0 ; then
-               case `./$dummy` in
-               0-0)    UNAME_MACHINE="alpha" ;;
-               1-0)    UNAME_MACHINE="alphaev5" ;;
-               1-1)    UNAME_MACHINE="alphaev56" ;;
-               1-101)  UNAME_MACHINE="alphapca56" ;;
-               2-303)  UNAME_MACHINE="alphaev6" ;;
-               2-307)  UNAME_MACHINE="alphaev67" ;;
-               esac
-               objdump --private-headers $dummy | \
-                 grep ld.so.1 > /dev/null
-               if test "$?" = 0 ; then
-                       LIBC="libc1"
-               fi
-       fi
-       rm -f $dummy.s $dummy
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev67 ;;
+        esac
+       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
        exit 0 ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
@@ -883,38 +819,27 @@ EOF
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
        # problems with other programs or directories called `ld' in the path.
-       ld_supported_emulations=`cd /; ld --help 2>&1 \
-                        | sed -ne '/supported emulations:/!d
+       ld_supported_targets=`cd /; ld --help 2>&1 \
+                        | sed -ne '/supported targets:/!d
                                    s/[         ][      ]*/ /g
-                                   s/.*supported emulations: *//
+                                   s/.*supported targets: *//
                                    s/ .*//
                                    p'`
-        case "$ld_supported_emulations" in
-         i*86linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit 0
-               ;;
-         elf_i*86)
+        case "$ld_supported_targets" in
+         elf32-i386)
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
                ;;
-         i*86coff)
+         a.out-i386-linux)
+               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+               exit 0 ;;               
+         coff-i386)
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit 0
-               ;;
-       esac
-       # Either a pre-BFD a.out linker (linux-gnuoldld)
-       # or one that does not give us useful --help.
-       # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
-       # If ld does not provide *any* "supported emulations:"
-       # that means it is gnuoldld.
-       test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-       case "${UNAME_MACHINE}" in
-       i*86)
-         VENDOR=pc;
-         ;;
-       *)
-         VENDOR=unknown;
-         ;;
+               exit 0 ;;
+         "")
+               # Either a pre-BFD a.out linker (linux-gnuoldld) or
+               # one that does not give us useful --help.
+               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+               exit 0 ;;
        esac
        # Determine whether the default compiler is a.out or elf
        cat >$dummy.c <<EOF
@@ -928,26 +853,28 @@ EOF
 #ifdef __ELF__
 # ifdef __GLIBC__
 #  if __GLIBC__ >= 2
-    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+    printf ("%s-pc-linux-gnu\n", argv[1]);
 #  else
-    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
 #  endif
 # else
-   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
 # endif
 #else
-  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+  printf ("%s-pc-linux-gnuaout\n", argv[1]);
 #endif
   return 0;
 }
 EOF
+       eval $set_cc_for_build
        $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
        rm -f $dummy.c $dummy
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
        ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
-# are messed up and put the nodename in both sysname and nodename.
     i*86:DYNIX/ptx:4*:*)
+       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+       # earlier versions are messed up and put the nodename in both
+       # sysname and nodename.
        echo i386-sequent-sysv4
        exit 0 ;;
     i*86:UNIX_SV:4.2MP:2.*)
@@ -966,14 +893,13 @@ EOF
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
        fi
        exit 0 ;;
-    i*86:*:5:7*)
-        # Fixed at (any) Pentium or better
-        UNAME_MACHINE=i586
-        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
-           echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
-       else
-           echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
-       fi
+    i*86:*:5:[78]*)
+       case `/bin/uname -X | grep "^Machine"` in
+           *486*)           UNAME_MACHINE=i486 ;;
+           *Pentium)        UNAME_MACHINE=i586 ;;
+           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+       esac
+       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
        exit 0 ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
@@ -1291,6 +1217,7 @@ main ()
 }
 EOF
 
+eval $set_cc_for_build
 $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
 rm -f $dummy.c $dummy
 
index 9564cc51f4cb13332bad256d5413e9065bb29763..6a8c852dd57592c96b887340891faef2c6c8064e 100644 (file)
@@ -3,10 +3,10 @@
 /* Define if you have the ANSI C header files.  */
 #undef STDC_HEADERS
 
-/* Define to __s64 if <sys/types.h> does not define */
+/* Define to int64_t if <sys/types.h> does not define */
 #undef quad_t
 
-/* Define to __u64 if <sys/types.h> does not define */
+/* Define to uint64_t if <sys/types.h> does not define */
 #undef u_quad_t
 
 /* Define if you have the err function.  */
index a06a480adafdfbe81925988759b3e29088d6d2e0..578b302738e7aa97b594d8f33d451cfe9b776464 100755 (executable)
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 #   Free Software Foundation, Inc.
 
-timestamp='2001-04-20'
+timestamp='2001-06-08'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -117,7 +117,7 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -157,6 +157,14 @@ case $os in
                os=-vxworks
                basic_machine=$1
                ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -230,11 +238,11 @@ case $basic_machine in
                | mips16 | mips64 | mipsel | mips64el \
                | mips64orion | mips64orionel | mipstx39 | mipstx39el \
                | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
-               | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
+               | mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
                | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
                | v850 | c4x \
                | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
-               | pj | pjl | h8500)
+               | pj | pjl | h8500 | z8k)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -242,7 +250,7 @@ case $basic_machine in
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
                ;;
 
        # We use `pc' rather than `unknown'
@@ -271,8 +279,8 @@ case $basic_machine in
              | alphaev6[78]-* \
              | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
              | clipper-* | orion-* \
-             | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-             | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
+             | sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
+             | powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
              | mips16-* | mips64-* | mipsel-* \
              | mips64el-* | mips64orion-* | mips64orionel-* \
              | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
@@ -881,6 +889,10 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
+       windows32)
+               basic_machine=i386-pc
+               os=-windows32-msvcrt
+               ;;
        xmp)
                basic_machine=xmp-cray
                os=-unicos
@@ -1018,6 +1030,7 @@ case $os in
              | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
index 750475d6968732074c6f73d0beee2bb7dd979c54..056aad7ec235e10564032d4a37f2e42e630c4c08 100755 (executable)
--- a/configure
+++ b/configure
@@ -2503,7 +2503,7 @@ fi
 echo "$ac_t""$ac_cv_type_quad_t" 1>&6
 if test $ac_cv_type_quad_t = no; then
   cat >> confdefs.h <<\EOF
-#define quad_t __s64
+#define quad_t int64_t
 EOF
 
 fi
@@ -2536,7 +2536,7 @@ fi
 echo "$ac_t""$ac_cv_type_u_quad_t" 1>&6
 if test $ac_cv_type_u_quad_t = no; then
   cat >> confdefs.h <<\EOF
-#define u_quad_t __u64
+#define u_quad_t uint64_t
 EOF
 
 fi
index 3166457ef8322b8921a23629784325c2381d2848..23abf0fe90d6299aa7e831b708bbb35279525e10 100644 (file)
@@ -429,8 +429,8 @@ fi
 dnl
 dnl Check for types
 dnl
-AC_CHECK_TYPE(quad_t, __s64)
-AC_CHECK_TYPE(u_quad_t, __u64)
+AC_CHECK_TYPE(quad_t, int64_t)
+AC_CHECK_TYPE(u_quad_t, uint64_t)
 
 dnl
 dnl Compute top_buildir
index d6bae02954fd36db464e1a97a6f48375702e16f3..c4d8dca10020176d8889366dabfa480513b152b1 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
- *     $Id: dump.h,v 1.40 2002/07/29 12:00:33 stelian Exp $
+ *     $Id: dump.h,v 1.41 2002/12/12 11:49:35 stelian Exp $
  */
 
 /*-
@@ -214,9 +214,11 @@ void       do_exclude_ino __P((dump_ino_t ino, const char *));
 #define DIALUP "ttyd"                  /* prefix for dialups */
 #endif
 
-struct fstab *fstabsearch __P((const char *key));      /* search fs_file and fs_spec */
+#include <mntent.h>
+
+struct mntent *fstabsearch __P((const char *key));     /* search fs_file and fs_spec */
 #ifdef __linux__
-struct fstab *fstabsearchdir __P((const char *key, char *dir));        /* search fs_file and fs_spec */
+struct mntent *fstabsearchdir __P((const char *key, char *dir));       /* search fs_file and fs_spec */
 #endif
 
 /*
@@ -225,7 +227,7 @@ struct      fstab *fstabsearchdir __P((const char *key, char *dir));        /* search fs_fil
  */
 struct dumpdates {
        char    dd_name[MAXPATHLEN+3];
-       struct fstab *dd_fstab;
+       struct mntent *dd_fstab;
        char    dd_level;
        time_t  dd_ddate;
 };
@@ -263,15 +265,6 @@ extern int errno;
 int dump_fs_open(const char *disk, ext2_filsys *fs);
 #endif
 
-#ifndef        __linux__
-#ifndef        _PATH_UTMP
-#define        _PATH_UTMP      "/etc/utmp"
-#endif
-#ifndef        _PATH_FSTAB
-#define        _PATH_FSTAB     "/etc/fstab"
-#endif
-#endif
-
 #ifdef sunos
 extern char *calloc();
 extern char *malloc();
index 508ec15fab28d3734a7e8bcc90b6535ffef42bf6..64246743b14f73e8559f1ed2d75f93fdeb371a54 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.77 2002/11/15 09:49:40 stelian Exp $";
+       "$Id: main.c,v 1.78 2002/12/12 11:49:35 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -49,13 +49,13 @@ static const char rcsid[] =
 #include <ctype.h>
 #include <compaterr.h>
 #include <fcntl.h>
-#include <fstab.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <mntent.h>
 
 #include <sys/param.h>
 #include <sys/time.h>
@@ -198,7 +198,7 @@ main(int argc, char *argv[])
        dump_ino_t ino;
        int dirty;
        struct dinode *dp;
-       struct  fstab *dt;
+       struct mntent *dt;
        char *map;
        int ch;
        int i, anydirskipped;
@@ -570,9 +570,9 @@ main(int argc, char *argv[])
                        msg("The ENTIRE dump is aborted.\n");
                        exit(X_STARTUP);
                }
-               disk = rawname(dt->fs_spec);
-               (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN);
-               (void)strncpy(spcl.c_filesys, dt->fs_file, NAMELEN);
+               disk = rawname(dt->mnt_fsname);
+               (void)strncpy(spcl.c_dev, dt->mnt_fsname, NAMELEN);
+               (void)strncpy(spcl.c_filesys, dt->mnt_dir, NAMELEN);
        } else {
 #ifdef __linux__
 #ifdef HAVE_REALPATH
@@ -584,9 +584,9 @@ main(int argc, char *argv[])
                 * a filesystem specified in fstab. Search for it.
                 */
                if ((dt = fstabsearch(pathname)) != NULL) {
-                       disk = rawname(dt->fs_spec);
-                       (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN);
-                       (void)strncpy(spcl.c_filesys, dt->fs_file, NAMELEN);
+                       disk = rawname(dt->mnt_fsname);
+                       (void)strncpy(spcl.c_dev, dt->mnt_fsname, NAMELEN);
+                       (void)strncpy(spcl.c_filesys, dt->mnt_dir, NAMELEN);
                } else {
                        /*
                         * The argument was not found in the fstab
@@ -595,11 +595,11 @@ main(int argc, char *argv[])
                        dt = fstabsearchdir(pathname, directory);
                        if (dt != NULL) {
                                char name[MAXPATHLEN];
-                               (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN);
+                               (void)strncpy(spcl.c_dev, dt->mnt_fsname, NAMELEN);
                                (void)snprintf(name, sizeof(name), "%s (dir %s)",
-                                             dt->fs_file, directory);
+                                             dt->mnt_dir, directory);
                                (void)strncpy(spcl.c_filesys, name, NAMELEN);
-                               disk = rawname(dt->fs_spec);
+                               disk = rawname(dt->mnt_fsname);
                        } else {
                                (void)strncpy(spcl.c_dev, disk, NAMELEN);
                                (void)strncpy(spcl.c_filesys, "an unlisted file system",
@@ -798,14 +798,14 @@ main(int argc, char *argv[])
                /* check if file is a directory */
                if (!(statbuf.st_mode & S_IFDIR))
                        anydirskipped2 = maponefile(maxino, &tapesize, 
-                                                   p+strlen(dt->fs_file));
+                                                   p+strlen(dt->mnt_dir));
                else
                        /* read directory inodes.
                         * NOTE: nested directories are not recognized 
                         * so inodes may be umped twice!
                         */
                        anydirskipped2 = mapfilesfromdir(maxino, &tapesize, 
-                                                        p+strlen(dt->fs_file));
+                                                        p+strlen(dt->mnt_dir));
                if (!anydirskipped)
                        anydirskipped = anydirskipped2;
                argv++;
index 81823a7865a0e7d26f6a9248ea87ca209c9ddbe2..628c9817ea2c1484350b2dd7c6b2f406841ad32d 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: optr.c,v 1.32 2002/07/19 14:57:39 stelian Exp $";
+       "$Id: optr.c,v 1.33 2002/12/12 11:49:35 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -51,7 +51,8 @@ static const char rcsid[] =
 #include <time.h>
 
 #include <errno.h>
-#include <fstab.h>
+#include <mntent.h>
+#include <paths.h>
 #include <grp.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -423,67 +424,98 @@ quit(fmt, va_alist)
  *     we don't actually do it
  */
 
-static struct fstab *
-allocfsent(struct fstab *fs)
+struct pfstab {
+       struct  pfstab *pf_next;
+       struct  dumpdates *pf_dd;
+       struct  mntent *pf_mntent;
+};
+
+static struct pfstab *table;
+
+static struct mntent *
+allocfsent(struct mntent *fs)
 {
-       struct fstab *new;
+       struct mntent *new;
+       const char *disk;
+       struct stat buf, tabbuf;
+       struct pfstab *tabpf;
+       struct mntent *tabfs;
 
-       new = (struct fstab *)malloc(sizeof (*fs));
+       new = (struct mntent *)malloc(sizeof (*fs));
        if (new == NULL)
                quit("%s\n", strerror(errno));
-       if (strlen(fs->fs_file) > 1 && fs->fs_file[strlen(fs->fs_file) - 1] == '/')
-               fs->fs_file[strlen(fs->fs_file) - 1] = '\0';
-       if ((new->fs_file = strdup(fs->fs_file)) == NULL ||
-           (new->fs_type = strdup(fs->fs_type)) == NULL ||
-           (new->fs_vfstype = strdup(fs->fs_vfstype)) == NULL ||
-           (new->fs_spec = strdup(fs->fs_spec)) == NULL)
+
+       /* Translade UUID=, LABEL= ... */
+       disk = get_device_name(fs->mnt_fsname);
+       if (disk == NULL)
+               quit("Cannot find a disk having %s\n", fs->mnt_fsname);
+
+       /* Discard non block devices */
+       if (stat(disk, &buf) != 0 || !S_ISBLK(buf.st_mode)) {
+               free(new);
+               return NULL;
+       }
+
+       /* Discard same major/minor devices */
+       for (tabpf = table; tabpf != NULL; tabpf = tabpf->pf_next) {
+               tabfs = tabpf->pf_mntent;
+               if (stat(tabfs->mnt_fsname, &tabbuf) != 0)
+                       /* should not happen */
+                       quit("Cannot access %s\n", tabfs->mnt_fsname);
+               if (tabbuf.st_rdev == buf.st_rdev) {
+                       free(new);
+                       return NULL;
+               }
+       }
+               
+       if (strlen(fs->mnt_dir) > 1 && fs->mnt_dir[strlen(fs->mnt_dir) - 1] == '/')
+               fs->mnt_dir[strlen(fs->mnt_dir) - 1] = '\0';
+       if ((new->mnt_dir = strdup(fs->mnt_dir)) == NULL ||
+           (new->mnt_type = strdup(fs->mnt_type)) == NULL ||
+           (new->mnt_opts = strdup(fs->mnt_opts)) == NULL ||
+           (new->mnt_fsname = strdup(disk)) == NULL)
                quit("%s\n", strerror(errno));
-       new->fs_passno = fs->fs_passno;
-       new->fs_freq = fs->fs_freq;
+       new->mnt_passno = fs->mnt_passno;
+       new->mnt_freq = fs->mnt_freq;
        return (new);
 }
 
-struct pfstab {
-       struct  pfstab *pf_next;
-       struct  dumpdates *pf_dd;
-       struct  fstab *pf_fstab;
-};
-
-static struct pfstab *table;
-
 void
 getfstab(void)
 {
-       struct fstab *fs;
+       struct mntent *fs;
        struct pfstab *pf;
        struct pfstab *pfold = NULL;
-
-       if (setfsent() == 0) {
-               msg("Can't open %s for dump table information: %s\n",
-                   _PATH_FSTAB, strerror(errno));
-               return;
-       }
-       while ((fs = getfsent()) != NULL) {
-               if (strcmp(fs->fs_type, FSTAB_RW) &&
-                   strcmp(fs->fs_type, FSTAB_RO) &&
-                   strcmp(fs->fs_type, FSTAB_RQ))
+       FILE *mntfp;
+       char *mnttables[] = { _PATH_MNTTAB, _PATH_MOUNTED, 0 };
+       int i;
+
+       for (i = 0; mnttables[i]; i++) {
+               mntfp = setmntent(mnttables[i], "r");
+               if (mntfp == NULL) {
+                       msg("Can't open %s for dump table information: %s\n",
+                           mnttables[i], strerror(errno));
                        continue;
-               fs = allocfsent(fs);
-               fs->fs_passno = 0;
-               if ((pf = (struct pfstab *)malloc(sizeof (*pf))) == NULL)
-                       quit("%s\n", strerror(errno));
-               pf->pf_fstab = fs;
-               pf->pf_next = NULL;
-
-               /* keep table in /etc/fstab order for use with -w and -W */
-               if (pfold) {
-                       pfold->pf_next = pf;
-                       pfold = pf;
-               } else
-                       pfold = table = pf;
-
+               }
+               while ((fs = getmntent(mntfp)) != NULL) {
+                       fs = allocfsent(fs);
+                       if (!fs)
+                               continue;
+                       fs->mnt_passno = 0;
+                       if ((pf = (struct pfstab *)malloc(sizeof (*pf))) == NULL)
+                               quit("%s\n", strerror(errno));
+                       pf->pf_mntent = fs;
+                       pf->pf_next = NULL;
+       
+                       /* keep table in /etc/fstab order for use with -w and -W */
+                       if (pfold) {
+                               pfold->pf_next = pf;
+                               pfold = pf;
+                       } else
+                               pfold = table = pf;
+               }
+               (void) endmntent(mntfp);
        }
-       (void) endfsent();
 }
 
 /*
@@ -497,27 +529,27 @@ getfstab(void)
  *
  * The file name can omit the leading '/'.
  */
-struct fstab *
+struct mntent *
 fstabsearch(const char *key)
 {
        struct pfstab *pf;
-       struct fstab *fs;
+       struct mntent *fs;
        const char *rn;
 
        for (pf = table; pf != NULL; pf = pf->pf_next) {
-               fs = pf->pf_fstab;
-               if (strcmp(fs->fs_file, key) == 0 ||
-                   strcmp(fs->fs_spec, key) == 0)
+               fs = pf->pf_mntent;
+               if (strcmp(fs->mnt_dir, key) == 0 ||
+                   strcmp(fs->mnt_fsname, key) == 0)
                        return (fs);
-               rn = rawname(fs->fs_spec);
+               rn = rawname(fs->mnt_fsname);
                if (rn != NULL && strcmp(rn, key) == 0)
                        return (fs);
                if (key[0] != '/') {
-                       if (*fs->fs_spec == '/' &&
-                           strcmp(fs->fs_spec + 1, key) == 0)
+                       if (*fs->mnt_fsname == '/' &&
+                           strcmp(fs->mnt_fsname + 1, key) == 0)
                                return (fs);
-                       if (*fs->fs_file == '/' &&
-                           strcmp(fs->fs_file + 1, key) == 0)
+                       if (*fs->mnt_dir == '/' &&
+                           strcmp(fs->mnt_dir + 1, key) == 0)
                                return (fs);
                }
        }
@@ -525,12 +557,12 @@ fstabsearch(const char *key)
 }
 
 #ifdef __linux__
-struct fstab *
+struct mntent *
 fstabsearchdir(const char *key, char *directory)
 {
        struct pfstab *pf;
-       struct fstab *fs;
-       struct fstab *found_fs = NULL;
+       struct mntent *fs;
+       struct mntent *found_fs = NULL;
        unsigned int size = 0;
        struct stat buf;
 
@@ -538,14 +570,14 @@ fstabsearchdir(const char *key, char *directory)
                return NULL;
 
        for (pf = table; pf != NULL; pf = pf->pf_next) {
-               fs = pf->pf_fstab;
-               if (strlen(fs->fs_file) > size &&
-                   strlen(key) > strlen(fs->fs_file) &&
-                   strncmp(fs->fs_file, key, strlen(fs->fs_file)) == 0 &&
-                   (key[strlen(fs->fs_file)] == '/' ||
-                    fs->fs_file[strlen(fs->fs_file) - 1] == '/')) {
+               fs = pf->pf_mntent;
+               if (strlen(fs->mnt_dir) > size &&
+                   strlen(key) > strlen(fs->mnt_dir) &&
+                   strncmp(fs->mnt_dir, key, strlen(fs->mnt_dir)) == 0 &&
+                   (key[strlen(fs->mnt_dir)] == '/' ||
+                    fs->mnt_dir[strlen(fs->mnt_dir) - 1] == '/')) {
                        found_fs = fs;
-                       size = strlen(fs->fs_file);
+                       size = strlen(fs->mnt_dir);
                }
        }
        if (found_fs != NULL) {
@@ -605,7 +637,7 @@ lastdump(char arg) /* w ==> just what to do; W ==> most recent dumps */
        initdumptimes(0);       /* dumpdates input */
        if (ddatev == NULL && table == NULL) {
                (void) printf("No %s or %s file found\n",
-                             _PATH_FSTAB, _PATH_DUMPDATES);
+                             _PATH_MNTTAB, _PATH_DUMPDATES);
                return;
        }
 
@@ -624,7 +656,7 @@ lastdump(char arg) /* w ==> just what to do; W ==> most recent dumps */
 
                lastname = "??";
                ITITERATE(i, dtwalk) {
-                       struct fstab *dt;
+                       struct mntent *dt;
                        if (strncmp(lastname, dtwalk->dd_name,
                                sizeof(dtwalk->dd_name)) == 0)
                                continue;
@@ -636,15 +668,15 @@ lastdump(char arg) /* w ==> just what to do; W ==> most recent dumps */
                                 * A positive fs_freq means this
                                 * filesystem needs to be dumped.
                                 */
-                               dt->fs_passno = dtwalk->dd_ddate;
-                               if (dt->fs_freq > 0 && (dtwalk->dd_ddate <
-                                   tnow - (dt->fs_freq * 86400)))
-                                       dt->fs_freq = dtwalk->dd_level;
+                               dt->mnt_passno = dtwalk->dd_ddate;
+                               if (dt->mnt_freq > 0 && (dtwalk->dd_ddate <
+                                   tnow - (dt->mnt_freq * 86400)))
+                                       dt->mnt_freq = dtwalk->dd_level;
                                else
-                                       dt->fs_freq = -dtwalk->dd_level;
+                                       dt->mnt_freq = -dtwalk->dd_level;
 #ifdef FDEBUG
                                printf("%s fs_freq set to %d\n", lastname,
-                                       dt->fs_freq);
+                                       dt->mnt_freq);
 #endif
                        }
                }
@@ -652,19 +684,19 @@ lastdump(char arg) /* w ==> just what to do; W ==> most recent dumps */
 
        /* print in /etc/fstab order only those filesystem types we can dump */
        for (pf = table; pf != NULL; pf = pf->pf_next) {
-               struct fstab *dt = pf->pf_fstab;
+               struct mntent *dt = pf->pf_mntent;
                char **type;
 
                for (type = fstypes; *type != NULL; type++) {
-                       if (strncmp(dt->fs_vfstype, *type,
-                                   sizeof(dt->fs_vfstype)) == 0) {
-                               const char *disk = get_device_name(dt->fs_spec);
-                               print_wmsg(arg, dt->fs_freq > 0,
-                                          disk ? disk : dt->fs_spec,
-                                          dt->fs_freq < 0 ? -dt->fs_freq :
-                                                             dt->fs_freq,
-                                          dt->fs_file,
-                                          dt->fs_passno);
+                       if (strncmp(dt->mnt_type, *type,
+                                   sizeof(dt->mnt_type)) == 0) {
+                               const char *disk = get_device_name(dt->mnt_fsname);
+                               print_wmsg(arg, dt->mnt_freq > 0,
+                                          disk ? disk : dt->mnt_fsname,
+                                          dt->mnt_freq < 0 ? -dt->mnt_freq :
+                                                             dt->mnt_freq,
+                                          dt->mnt_dir,
+                                          dt->mnt_passno);
                        }
                }
        }