aboutsummaryrefslogtreecommitdiff
path: root/sbin/dump
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1999-03-21 23:47:38 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1999-03-21 23:47:38 +0000
commitf1a3bb13d801373c73b5f760f26466d8df25c962 (patch)
treee3330502bad9ebd1791f3b89b458b718242b49f7 /sbin/dump
parent99c81ca94d42910007c6e455580f248f9a16c22d (diff)
downloadsrc-f1a3bb13d801373c73b5f760f26466d8df25c962.tar.gz
src-f1a3bb13d801373c73b5f760f26466d8df25c962.zip
The attached patch to /usr/src/sbin/dump/optr.c changes the comparison
so that dumps are treated by dump -w as having been done on midnight of the day they were actually run. This makes dump -w behave as expected for regularly scheduled daily dumps - if they all run the same day. It makes dump -w behave strangely if you dump late in the day and check again after midnight, but that is the lesser of two evils. Submitted by: Mike Meyer <mwm@phone.net> PR: 9429
Notes
Notes: svn path=/head/; revision=44929
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/optr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 318cbd0c5147..cab39e8d8d3d 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: optr.c,v 1.5 1998/06/15 06:58:11 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -484,7 +484,7 @@ lastdump(arg)
register struct dumpdates *dtwalk;
char *lastname, *date;
int dumpme;
- time_t tnow;
+ time_t tnow, then;
(void) time(&tnow);
getfstab(); /* /etc/fstab input */
@@ -500,13 +500,13 @@ lastdump(arg)
if (strncmp(lastname, dtwalk->dd_name,
sizeof(dtwalk->dd_name)) == 0)
continue;
- date = (char *)ctime(&dtwalk->dd_ddate);
+ then = 86400 * (dtwalk->dd_ddate / 86400);
+ date = (char *)ctime(&then);
date[16] = '\0'; /* blast away seconds and year */
lastname = dtwalk->dd_name;
dt = fstabsearch(dtwalk->dd_name);
dumpme = (dt != NULL &&
- dt->fs_freq != 0 &&
- dtwalk->dd_ddate < tnow - (dt->fs_freq * 86400));
+ dt->fs_freq != 0 && then < tnow - (dt->fs_freq * 86400));
if (arg != 'w' || dumpme)
(void) printf(
"%c %8s\t(%6s) Last dump: Level %c, Date %s\n",