diff options
| author | Matthew Dillon <dillon@FreeBSD.org> | 2001-10-28 20:01:38 +0000 |
|---|---|---|
| committer | Matthew Dillon <dillon@FreeBSD.org> | 2001-10-28 20:01:38 +0000 |
| commit | 5b3817c60b5d4e7ac21b4576f820cad7e853b5d9 (patch) | |
| tree | 2aac20490200e00aba6e36dc6eaec794b658377d /sbin/dump | |
| parent | 237c4e3a9e1e8c006edac8167088dfb130597e5c (diff) | |
Notes
Diffstat (limited to 'sbin/dump')
| -rw-r--r-- | sbin/dump/itime.c | 16 | ||||
| -rw-r--r-- | sbin/dump/main.c | 23 |
2 files changed, 28 insertions, 11 deletions
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c index c1824c285956..593edee24545 100644 --- a/sbin/dump/itime.c +++ b/sbin/dump/itime.c @@ -162,9 +162,9 @@ getdumptime() continue; if (ddp->dd_level >= level) continue; - if (ddp->dd_ddate <= spcl.c_ddate) + if (ddp->dd_ddate <= time32_to_time(spcl.c_ddate)) continue; - spcl.c_ddate = ddp->dd_ddate; + spcl.c_ddate = time_to_time32(ddp->dd_ddate); lastlevel = ddp->dd_level; } } @@ -177,6 +177,7 @@ putdumptime() register int i; int fd; char *fname; + char *tmsg; if(uflag == 0) return; @@ -211,7 +212,7 @@ putdumptime() found: (void) strncpy(dtwalk->dd_name, fname, sizeof (dtwalk->dd_name)); dtwalk->dd_level = level; - dtwalk->dd_ddate = spcl.c_date; + dtwalk->dd_ddate = time32_to_time(spcl.c_date); ITITERATE(i, dtwalk) { dumprecout(df, dtwalk); @@ -221,8 +222,13 @@ putdumptime() if (ftruncate(fd, ftell(df))) quit("ftruncate (%s): %s\n", dumpdates, strerror(errno)); (void) fclose(df); - msg("level %c dump on %s", level, - spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date)); + if (spcl.c_date == 0) { + tmsg = "the epoch\n"; + } else { + time_t t = time32_to_time(spcl.c_date); + tmsg = ctime(&t); + } + msg("level %c dump on %s", level, tmsg); } static void diff --git a/sbin/dump/main.c b/sbin/dump/main.c index be639b7b881b..0e3b3f6f0e1a 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); |
