Module Name: src Committed By: christos Date: Thu Mar 11 01:32:59 UTC 2010
Modified Files: src/sbin/dump: itime.c main.c Log Message: PR/42952: The Grey Wolf: Fix for "true incremental". Don't overload level 9, use a new level "i" which is logically 10. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sbin/dump/itime.c cvs rdiff -u -r1.65 -r1.66 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/dump/itime.c diff -u src/sbin/dump/itime.c:1.17 src/sbin/dump/itime.c:1.18 --- src/sbin/dump/itime.c:1.17 Thu Feb 25 21:11:40 2010 +++ src/sbin/dump/itime.c Wed Mar 10 20:32:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: itime.c,v 1.17 2010/02/26 02:11:40 christos Exp $ */ +/* $NetBSD: itime.c,v 1.18 2010/03/11 01:32:59 christos Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: itime.c,v 1.17 2010/02/26 02:11:40 christos Exp $"); +__RCSID("$NetBSD: itime.c,v 1.18 2010/03/11 01:32:59 christos Exp $"); #endif #endif /* not lint */ @@ -146,13 +146,18 @@ /* * Go find the entry with the same name for a lower increment * and older date. If we are doing a true incremental, then - * we can use level 9 as a ref point + * we can use any level as a ref point. */ ITITERATE(i, ddp) { if (strncmp(fname, ddp->dd_name, sizeof (ddp->dd_name)) != 0) continue; - if ((!trueinc && (ddp->dd_level >= level)) || - (trueinc && (ddp->dd_level > level))) + /* trueinc: ostensibly could omit the second clause + * since if trueinc is set, we don't care about the level + * at all. + */ + /* if ((!trueinc && (ddp->dd_level >= level)) || + (trueinc && (ddp->dd_level > level))) */ + if (!trueinc && (ddp->dd_level >= level)) continue; if (ddp->dd_ddate <= iswap32(spcl.c_ddate)) continue; Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.65 src/sbin/dump/main.c:1.66 --- src/sbin/dump/main.c:1.65 Thu Feb 25 21:11:40 2010 +++ src/sbin/dump/main.c Wed Mar 10 20:32:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.65 2010/02/26 02:11:40 christos Exp $ */ +/* $NetBSD: main.c,v 1.66 2010/03/11 01:32:59 christos Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.65 2010/02/26 02:11:40 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.66 2010/03/11 01:32:59 christos Exp $"); #endif #endif /* not lint */ @@ -181,8 +181,8 @@ honorlevel = numarg("honor level", 0L, 10L); break; - case 'i': /* "true incremental" regardless level 9 */ - level = '9'; + case 'i': /* "true incremental" regardless level */ + level = 'i'; trueinc = 1; break; @@ -470,7 +470,8 @@ needswap = fs_read_sblock(sblock_buf); - spcl.c_level = iswap32(level - '0'); + /* true incremental is always a level 10 dump */ + spcl.c_level = trueinc? iswap32(10): iswap32(level - '0'); spcl.c_type = iswap32(TS_TAPE); spcl.c_date = iswap32(spcl.c_date); spcl.c_ddate = iswap32(spcl.c_ddate);