X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/c48b22c8583f6d6c55c6a6f6001cf4fdcc20aed1..5b56cc19fbd5ed6626a091aa9c5af7fa371dc73a:/util.c diff --git a/util.c b/util.c index bd0af33f..1752faeb 100644 --- a/util.c +++ b/util.c @@ -955,7 +955,27 @@ void msleep(int t) } -#ifdef __INSURE__ +/******************************************************************* + Determine if two file modification times are equivalent (either exact + or in the modification timestamp window established by --modify-window) + Returns 0 if the times should be treated as the same, 1 if the + first is later and -1 if the 2nd is later + *******************************************************************/ +int cmp_modtime(time_t file1, time_t file2) +{ + time_t diff; + extern int modify_window; + + if (file2 > file1) { + if (file2 - file1 <= modify_window) return 0; + return -1; + } + if (file1 - file2 <= modify_window) return 0; + return 1; +} + + +#ifdef __INSURE__XX #include /*******************************************************************