X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;ds=sidebyside;f=compat%2Flib%2Ffstab.c;h=2a601d52af9a8024393fe9c609750537d9ac04f3;hb=11856e771fadee7ddb9b5a613c91f562bf363da7;hp=32e6b028444fac6ff915308ac52f617280775842;hpb=ec387a1267f4cac7625cd5b6d1c1f080d39085b3;p=dump.git diff --git a/compat/lib/fstab.c b/compat/lib/fstab.c index 32e6b02..2a601d5 100644 --- a/compat/lib/fstab.c +++ b/compat/lib/fstab.c @@ -2,8 +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 */ /* @@ -37,10 +37,14 @@ * 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. - * - * $Id: fstab.c,v 1.4 1999/10/11 13:31:10 stelian Exp $ */ +#ifndef lint +static const char rcsid[] = + "$Id: fstab.c,v 1.12 2002/01/16 09:32:14 stelian Exp $"; +#endif /* not lint */ + +#include #include #include #include @@ -48,6 +52,7 @@ #include #include #include +#include static FILE *_fs_fp; static struct fstab _fs_fstab; @@ -55,6 +60,8 @@ 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) { @@ -65,10 +72,16 @@ int fstabscan(void) 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;