From: abbotti Date: Fri, 12 Apr 2002 19:21:02 +0000 (-0700) Subject: [svn] Compensate for MS Windows two-second granularity of file modification X-Git-Tag: v1.13~1805 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=4aaf8fdceaa1fc484e0937f744023527a70add8a [svn] Compensate for MS Windows two-second granularity of file modification timestamps. Submitted by Ian Abbott in <3CB7355C.21011.2134FDA@localhost>. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5fa69110..647a198f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2002-04012 Ian Abbott + + * http.c (http_loop): Compensate for MS Windows two-second + granularity of file modification time when comparing timestamps. + + * ftp.c (ftp_retrieve_list): Ditto. + 2002-04-12 Ian Abbott * utils.c (has_html_suffix_p): New function to test filename for diff --git a/src/ftp.c b/src/ftp.c index b45a7b52..c0ded718 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -1302,6 +1302,11 @@ ftp_retrieve_list (struct url *u, struct fileinfo *f, ccon *con) /* Else, get it from the file. */ local_size = st.st_size; tml = st.st_mtime; +#ifdef WINDOWS + /* Modification time granularity is 2 seconds for Windows, so + increase local time by 1 second for later comparison. */ + tml++; +#endif /* Compare file sizes only for servers that tell us correct values. Assumme sizes being equal for servers that lie about file size. */ diff --git a/src/http.c b/src/http.c index 3e62856d..c82eb32b 100644 --- a/src/http.c +++ b/src/http.c @@ -1520,6 +1520,11 @@ File `%s' already there, will not retrieve.\n"), *hstat.local_file); { use_ts = 1; tml = st.st_mtime; +#ifdef WINDOWS + /* Modification time granularity is 2 seconds for Windows, so + increase local time by 1 second for later comparison. */ + tml++; +#endif local_size = st.st_size; got_head = 0; }