X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Fmain.c;h=1dc780d210ef662256706cd492000de71578082d;hp=ca30a9c03483f9d97ded33f3388a479fb97241fe;hb=ec387a1267f4cac7625cd5b6d1c1f080d39085b3;hpb=ddd2ef55b78a62c4bc3daad18bef8a90e85a2052 diff --git a/dump/main.c b/dump/main.c index ca30a9c..1dc780d 100644 --- a/dump/main.c +++ b/dump/main.c @@ -37,22 +37,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $Id: main.c,v 1.5 1999/10/11 13:31:11 stelian Exp $ */ -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1980, 1991, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; -#endif -static const char rcsid[] = - "$Id: main.c,v 1.3 1999/10/11 12:59:18 stelian Exp $"; -#endif /* not lint */ - #include #include #ifdef __linux__ @@ -343,7 +331,6 @@ main(int argc, char *argv[]) signal(SIGTERM, sig); if (signal(SIGINT, interrupt) == SIG_IGN) signal(SIGINT, SIG_IGN); - set_operators(); /* /etc/group snarfed */ getfstab(); /* /etc/fstab snarfed */ /* @@ -394,10 +381,17 @@ main(int argc, char *argv[]) spcl.c_level = level - '0'; spcl.c_type = TS_TAPE; if (!Tflag) - getdumptime(); /* dumpdates snarfed */ + getdumptime(uflag); /* dumpdates snarfed */ + + if (spcl.c_ddate == 0 && spcl.c_level) { + msg("WARNING: There is no inferior level dump on this filesystem\n"); + msg("WARNING: Assuming a level 0 dump by default\n"); + level = '0'; + spcl.c_level = 0; + } msg("Date of this level %c dump: %s", level, -#ifdef __linux +#ifdef __linux__ spcl.c_date == 0 ? "the epoch\n" : ctime4(&spcl.c_date)); #else spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date)); @@ -550,7 +544,11 @@ main(int argc, char *argv[]) "can't allocate tape buffers - try a smaller blocking factor.\n"); startnewtape(1); +#ifdef __linux__ + (void)time4(&(tstart_writing)); +#else (void)time((time_t *)&(tstart_writing)); +#endif dumpmap(usedinomap, TS_CLRI, maxino - 1); msg("dumping (Pass III) [directories]\n"); @@ -595,7 +593,11 @@ main(int argc, char *argv[]) (void)dumpino(dp, ino); } +#ifdef __linux__ + (void)time4(&(tend_writing)); +#else (void)time((time_t *)&(tend_writing)); +#endif spcl.c_type = TS_END; for (i = 0; i < ntrec; i++) writeheader(maxino - 1);