#include <errno.h>
#define ERRCODE_RANGE 8 /* from error_table.h */
#define CLOCKSKEW 2 /* not really skew, but resolution */
+#define CLOCKADJ(x) (((x) < CLOCKSKEW) ? 0 : (x) - CLOCKSKEW)
/* for UV_MoveVolume() recovery */
newVol);
VDONE;
- fromDate = tstatus.creationDate - CLOCKSKEW;
+ fromDate = CLOCKADJ(tstatus.creationDate);
} else {
/* With RV_NOCLONE, just do a full copy from the source */
fromDate = 0;
cloneVol);
VDONE;
- fromDate = tstatus.creationDate - CLOCKSKEW;
+ fromDate = CLOCKADJ(tstatus.creationDate);
} else {
fromDate = 0;
}
VDONE;
/* Using the update date should be OK here, but add some fudge */
- cloneFromDate = tstatus.updateDate - CLOCKSKEW;
+ cloneFromDate = CLOCKADJ(tstatus.updateDate);
if ((flags & RV_NOCLONE))
fromDate = cloneFromDate;
code);
goto fail;
}
- *crtimePtr = tstatus.creationDate - CLOCKSKEW;
- *uptimePtr = tstatus.updateDate - CLOCKSKEW;
+ *crtimePtr = CLOCKADJ(tstatus.creationDate);
+ *uptimePtr = CLOCKADJ(tstatus.updateDate);
}
return 0;