From: Benjamin Kaduk Date: Wed, 10 Dec 2014 19:07:14 +0000 (-0500) Subject: Handle backupDate of zero X-Git-Tag: upstream/1.6.17^2~48 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=11c4c6394d56f819a2e92b2651525b56707a4970;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. Reviewed-on: http://gerrit.openafs.org/11627 Tested-by: BuildBot Reviewed-by: Jeffrey Altman (cherry picked from commit 34e495d69a8831c57cac2ccf18898e63f02c7745) Change-Id: Ia8250ed6e699d2ed8e2b5de7481c54ae65b0718c Reviewed-on: http://gerrit.openafs.org/11826 Reviewed-by: Daria Phoebe Brashear Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Stephan Wiesand --- diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index a3e8c7ae5..915b70a37 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -1048,7 +1048,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 fc5f62e54..0820e2544 100644 --- a/src/volser/vol-dump.c +++ b/src/volser/vol-dump.c @@ -418,7 +418,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;