X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=compat%2Flib%2Ffstab.c;h=de95455debc40b916a6f25112eda8ddf1e369cb1;hb=ba3af39e8b08027d3338b5533bddc86a9c803a74;hp=3bbae804403891945327967a8cd5ee9e54b3496c;hpb=df9ae507502f413c72119dde6ea3d35c91dba5bf;p=dump.git diff --git a/compat/lib/fstab.c b/compat/lib/fstab.c index 3bbae80..de95455 100644 --- a/compat/lib/fstab.c +++ b/compat/lib/fstab.c @@ -2,7 +2,8 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999 + * Stelian Pop , 1999-2000 + * Stelian Pop - AlcĂ´ve , 2000-2002 */ /* @@ -40,9 +41,10 @@ #ifndef lint static const char rcsid[] = - "$Id: fstab.c,v 1.5 1999/10/13 09:57:19 stelian Exp $"; + "$Id: fstab.c,v 1.13 2002/01/25 15:08:59 stelian Exp $"; #endif /* not lint */ +#include #include #include #include @@ -50,6 +52,7 @@ static const char rcsid[] = #include #include #include +#include static FILE *_fs_fp; static struct fstab _fs_fstab; @@ -57,20 +60,28 @@ 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; - register char *cp; + char *cp; int typexx; #define MAXLINELENGTH 1024 char subline[MAXLINELENGTH]; for (;;) { + const char *device_name; if (!(mnt = getmntent(_fs_fp))) return 0; - _fs_fstab.fs_spec = mnt->mnt_fsname; + 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;