X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Foptr.c;h=a4504da1520f0078201bfbb2e295cfc6e69c3222;hp=8d72cab7ee83e26ed8b4802c5b6d2f51b6964a72;hb=97be3358a32b246d4336692ebad4b1c366446932;hpb=e1abc9ce25132eef1239047a071c2c1d4822dd9f diff --git a/dump/optr.c b/dump/optr.c index 8d72cab..a4504da 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: optr.c,v 1.36 2003/03/30 15:40:36 stelian Exp $"; + "$Id: optr.c,v 1.39 2004/07/05 15:12:45 stelian Exp $"; #endif /* not lint */ #include @@ -444,7 +444,7 @@ allocfsent(struct mntent *fs) /* Translade UUID=, LABEL= ... */ disk = get_device_name(fs->mnt_fsname); if (disk == NULL) - quit("Cannot find a disk having %s\n", fs->mnt_fsname); + disk = strdup(fs->mnt_fsname); /* Discard non block devices */ if (stat(disk, &buf) != 0 || !S_ISBLK(buf.st_mode)) { @@ -460,6 +460,12 @@ allocfsent(struct mntent *fs) quit("Cannot access %s\n", tabfs->mnt_fsname); if (tabbuf.st_rdev == buf.st_rdev) { free(new); + /* Copy passno and freq from /etc/fstab because + * /etc/mtab does always have them as 0 0 */ + if (!tabfs->mnt_passno) + tabfs->mnt_passno = fs->mnt_passno; + if (!tabfs->mnt_freq) + tabfs->mnt_freq = fs->mnt_freq; return NULL; } } @@ -614,7 +620,7 @@ print_wmsg(char arg, int dumpme, const char *dev, int level, date = (char *)ctime(&ddate); d = strchr(date, '\n'); if (d) *d = '\0'; - printf("Level %c, Date %s\n", level, date); + printf("Level %d, Date %s\n", level, date); } else printf("never\n"); }