X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9ec16c83be3164bdcfe8412933d5b7fc86cabcb1..ff81e809f46293171a332a2faa320aca57277b4b:/util.c diff --git a/util.c b/util.c index bd0af33f..48935cc4 100644 --- a/util.c +++ b/util.c @@ -1,6 +1,7 @@ -/* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 +/* -*- c-file-style: "linux" -*- + + Copyright (C) 1996-2000 by Andrew Tridgell + Copyright (C) Paul Mackerras 1996 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -955,7 +956,26 @@ 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) +{ + 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 /*******************************************************************