diff options
Diffstat (limited to '')
| -rw-r--r-- | src/conditionfiletime.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/conditionfiletime.cpp b/src/conditionfiletime.cpp index abcb3f3..148ffac 100644 --- a/src/conditionfiletime.cpp +++ b/src/conditionfiletime.cpp | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | #include <sys/types.h> | 4 | #include <sys/types.h> |
| 5 | #include <sys/stat.h> | 5 | #include <sys/stat.h> |
| 6 | #include <unistd.h> | 6 | #include <unistd.h> |
| 7 | #include "statcache.h" | ||
| 8 | 7 | ||
| 9 | #include <bu/sio.h> | 8 | #include <bu/sio.h> |
| 10 | using namespace Bu; | 9 | using namespace Bu; |
| @@ -19,7 +18,6 @@ ConditionFileTime::~ConditionFileTime() | |||
| 19 | 18 | ||
| 20 | bool ConditionFileTime::shouldExec( class Runner &r, Target &rTarget ) | 19 | bool ConditionFileTime::shouldExec( class Runner &r, Target &rTarget ) |
| 21 | { | 20 | { |
| 22 | StatCache &Stat = StatCache::getInstance(); | ||
| 23 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); j; j++ ) | 21 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); j; j++ ) |
| 24 | { | 22 | { |
| 25 | if( access( (*j).getStr(), F_OK ) ) | 23 | if( access( (*j).getStr(), F_OK ) ) |
| @@ -32,20 +30,22 @@ bool ConditionFileTime::shouldExec( class Runner &r, Target &rTarget ) | |||
| 32 | } | 30 | } |
| 33 | } | 31 | } |
| 34 | 32 | ||
| 35 | time_t tOut = 0, tmp; | 33 | time_t tOut = 0; |
| 34 | struct stat s; | ||
| 36 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); | 35 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); |
| 37 | j; j++ ) | 36 | j; j++ ) |
| 38 | { | 37 | { |
| 39 | tmp = Stat.mtime( *j ); | 38 | stat( (*j).getStr(), &s ); |
| 40 | if( tOut == 0 || tOut > tmp ) | 39 | if( tOut == 0 || tOut > s.st_mtime ) |
| 41 | { | 40 | { |
| 42 | tOut = tmp; | 41 | tOut = s.st_mtime; |
| 43 | } | 42 | } |
| 44 | } | 43 | } |
| 45 | for( StrList::const_iterator j = rTarget.getInputList().begin(); | 44 | for( StrList::const_iterator j = rTarget.getInputList().begin(); |
| 46 | j; j++ ) | 45 | j; j++ ) |
| 47 | { | 46 | { |
| 48 | if( tOut < Stat.mtime( *j ) ) | 47 | stat( (*j).getStr(), &s ); |
| 48 | if( tOut < s.st_mtime ) | ||
| 49 | { | 49 | { |
| 50 | //sio << "-- Target processed because '" << *j | 50 | //sio << "-- Target processed because '" << *j |
| 51 | // << "' is newer than output." << sio.nl; | 51 | // << "' is newer than output." << sio.nl; |
| @@ -57,7 +57,8 @@ bool ConditionFileTime::shouldExec( class Runner &r, Target &rTarget ) | |||
| 57 | for( StrList::const_iterator j = rTarget.getRequiresList().begin(); | 57 | for( StrList::const_iterator j = rTarget.getRequiresList().begin(); |
| 58 | j; j++ ) | 58 | j; j++ ) |
| 59 | { | 59 | { |
| 60 | if( tOut < Stat.mtime( *j ) ) | 60 | stat( (*j).getStr(), &s ); |
| 61 | if( tOut < s.st_mtime ) | ||
| 61 | { | 62 | { |
| 62 | //sio << "-- Target processed because '" << *j | 63 | //sio << "-- Target processed because '" << *j |
| 63 | // << "' is newer than output." << sio.nl; | 64 | // << "' is newer than output." << sio.nl; |
