From 784c48029b64a2f6d4958d9ad10f554badd787db Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 16 Apr 2003 10:01:17 +0000 Subject: [PATCH] Workaround: change timestamp of 0, to 1, so that Jam does not consider file as missing. This is needed because /cygdrive on cygwin has the zero timestamp. * new/fileunix.c (file_time): The above change. [SVN r18256] --- historic/jam/src/fileunix.c | 8 +++++++- jam_src/fileunix.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/historic/jam/src/fileunix.c b/historic/jam/src/fileunix.c index 7fd102d22..7589ad293 100644 --- a/historic/jam/src/fileunix.c +++ b/historic/jam/src/fileunix.c @@ -182,7 +182,13 @@ file_time( if( stat( filename, &statbuf ) < 0 ) return -1; - *time = statbuf.st_mtime; + /* Technically, existing files can have 0 as statbuf.st_mtime + --- in particular, the /cygdrive directory under cygwin. However, + though all the code jam assumes that timestamp of 0 means + "does not exist" and will try to create the "missing" target, causing + problems. Work around this problem by chanding 0 to 1. + */ + *time = statbuf.st_mtime ? statbuf.st_mtime : 1 ; return 0; } diff --git a/jam_src/fileunix.c b/jam_src/fileunix.c index 7fd102d22..7589ad293 100644 --- a/jam_src/fileunix.c +++ b/jam_src/fileunix.c @@ -182,7 +182,13 @@ file_time( if( stat( filename, &statbuf ) < 0 ) return -1; - *time = statbuf.st_mtime; + /* Technically, existing files can have 0 as statbuf.st_mtime + --- in particular, the /cygdrive directory under cygwin. However, + though all the code jam assumes that timestamp of 0 means + "does not exist" and will try to create the "missing" target, causing + problems. Work around this problem by chanding 0 to 1. + */ + *time = statbuf.st_mtime ? statbuf.st_mtime : 1 ; return 0; }