From: Benjamin Kaduk Date: Wed, 10 Dec 2014 19:07:14 +0000 (-0500) Subject: Handle backupDate of zero X-Git-Tag: upstream/1.8.0_pre1^2~356 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=34e495d69a8831c57cac2ccf18898e63f02c7745;p=packages%2Fo%2Fopenafs.git Handle backupDate of zero In older versions of OpenAFS (prior to 2001), the backupDate was never set. Try to provide somewhat more reasonable behavior in this case, by using a different date in that case. Change-Id: Id74ce003c6a2317b06e78ba64d6891229c16421a Reviewed-on: http://gerrit.openafs.org/11627 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 3835031a9..21ed80358 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -1045,7 +1045,9 @@ DumpDumpHeader(struct iod *iodp, Volume * vp, dumpTimes[1] = V_creationDate(vp); /* until clone was updated */ break; case backupVolume: - dumpTimes[1] = V_backupDate(vp); /* until backup was made */ + /* until backup was made */ + dumpTimes[1] = V_backupDate(vp) != 0 ? V_backupDate(vp) : + V_creationDate(vp); break; default: code = EINVAL; diff --git a/src/volser/vol-dump.c b/src/volser/vol-dump.c index c78f1c5d4..f8ed4be2a 100644 --- a/src/volser/vol-dump.c +++ b/src/volser/vol-dump.c @@ -383,7 +383,9 @@ DumpDumpHeader(int dumpfd, Volume * vp, afs_int32 fromtime) dumpTimes[1] = V_creationDate(vp); /* until clone was updated */ break; case backupVolume: - dumpTimes[1] = V_backupDate(vp); /* until backup was made */ + /* until backup was made */ + dumpTimes[1] = V_backupDate(vp) != 0 ? V_backupDate(vp) : + V_creationDate(vp); break; default: code = EINVAL;