inc-recursive copy that is preserving directory times. e.g. using
--omit-dir-times will avoid these early directories being created.
+ - Fix a bug in cmp_time() that would return a wrong result if the 2 times
+ differed by an amount greater than what a time_t can hold.
+
DEVELOPER RELATED:
- We now include an example systemd file (in packaging/systemd).
int cmp_time(time_t file1, time_t file2)
{
if (file2 > file1) {
- if (file2 - file1 <= modify_window)
- return 0;
- return -1;
+ /* The final comparison makes sure that modify_window doesn't overflow a
+ * time_t, which would mean that file2 must be in the equality window. */
+ if (!modify_window || (file2 > file1 + modify_window && file1 + modify_window > file1))
+ return -1;
+ } else if (file1 > file2) {
+ if (!modify_window || (file1 > file2 + modify_window && file2 + modify_window > file2))
+ return 1;
}
- if (file1 - file2 <= modify_window)
- return 0;
- return 1;
+ return 0;
}
-
#ifdef __INSURE__XX
#include <dlfcn.h>