X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Foptr.c;h=2d898800df91f336c54736fd1db1d30ce5406716;hb=008af4194627f2026f9a66f38953724c0c364c81;hp=628c9817ea2c1484350b2dd7c6b2f406841ad32d;hpb=1a886de8480fc5d0b842613f2cf375415d94bbb7;p=dump.git diff --git a/dump/optr.c b/dump/optr.c index 628c981..2d89880 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -18,11 +18,7 @@ * 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 + * 3. 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. * @@ -41,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: optr.c,v 1.33 2002/12/12 11:49:35 stelian Exp $"; + "$Id: optr.c,v 1.37 2003/04/10 07:59:05 stelian Exp $"; #endif /* not lint */ #include @@ -464,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; } } @@ -487,7 +489,7 @@ getfstab(void) struct pfstab *pf; struct pfstab *pfold = NULL; FILE *mntfp; - char *mnttables[] = { _PATH_MNTTAB, _PATH_MOUNTED, 0 }; + char *mnttables[] = { _PATH_MOUNTED, _PATH_MNTTAB, 0 }; int i; for (i = 0; mnttables[i]; i++) { @@ -637,7 +639,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_MNTTAB, _PATH_DUMPDATES); + _PATH_MNTTAB, dumpdates); return; }