summaryrefslogtreecommitdiffstats
path: root/sbin/dump/main.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-10-28 20:01:38 +0000
committerdillon <dillon@FreeBSD.org>2001-10-28 20:01:38 +0000
commit41f4e0eb175e0e1ec2c7fa0af905e97ed76996c7 (patch)
tree2aac20490200e00aba6e36dc6eaec794b658377d /sbin/dump/main.c
parent5b521f3c4f8da9d35e865fb9daa7a51e4fa00adb (diff)
downloadFreeBSD-src-41f4e0eb175e0e1ec2c7fa0af905e97ed76996c7.zip
FreeBSD-src-41f4e0eb175e0e1ec2c7fa0af905e97ed76996c7.tar.gz
Make the protocol/dumprestore.h header match restore's idea of the dump
header for the case where sizeof(time_t) != sizeof(int). dumprestore.h was embedding time_t when it should have been embedding int32_t. Use time_to_time32() and time32_to_time() to convert between the protocoll/file-format time and time_t.
Diffstat (limited to 'sbin/dump/main.c')
-rw-r--r--sbin/dump/main.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index be639b7..0e3b3f6 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -105,9 +105,10 @@ main(argc, argv)
register int ch;
int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1;
ino_t maxino;
+ char *tmsg;
+ time_t t;
- spcl.c_date = 0;
- (void)time((time_t *)&spcl.c_date);
+ spcl.c_date = time_to_time32(time(NULL));
tsize = 0; /* Default later, based on 'c' option for cart tapes */
if ((tape = getenv("TAPE")) == NULL)
@@ -313,10 +314,20 @@ main(argc, argv)
if (!Tflag)
getdumptime(); /* /etc/dumpdates snarfed */
- msg("Date of this level %c dump: %s", level,
- spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date));
- msg("Date of last level %c dump: %s", lastlevel,
- spcl.c_ddate == 0 ? "the epoch\n" : ctime(&spcl.c_ddate));
+ if (spcl.c_date == 0) {
+ tmsg = "the epoch\n";
+ } else {
+ time_t t = time32_to_time(spcl.c_date);
+ tmsg = ctime(&t);
+ }
+ msg("Date of this level %c dump: %s", level, tmsg);
+ if (spcl.c_ddate == 0) {
+ tmsg = "the epoch\n";
+ } else {
+ time_t t = time32_to_time(spcl.c_ddate);
+ tmsg = ctime(&t);
+ }
+ msg("Date of last level %c dump: %s", lastlevel, tmsg);
msg("Dumping %s ", disk);
if (dt != NULL)
msgtail("(%s) ", dt->fs_file);
OpenPOWER on IntegriCloud