From 34e495d69a8831c57cac2ccf18898e63f02c7745 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Wed, 10 Dec 2014 14:07:14 -0500 Subject: [PATCH] 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 --- src/volser/dumpstuff.c | 4 +++- src/volser/vol-dump.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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; -- 2.39.5