From 88af0d35094c1b2e7def639382611f73312d6d7c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 9 Feb 2014 16:32:49 -0500 Subject: [PATCH] Fix --skip-identical mis-detecting on OS-X, bug707. --- Changes | 2 ++ src/V3File.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index fc0a6cabb..c87196b85 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix array bound checks on real variables. +**** Fix --skip-identical mis-detecting on OS-X, bug707. + * Verilator 3.855 2014-01-18 diff --git a/src/V3File.cpp b/src/V3File.cpp index dc14d7a07..6e4166b52 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -67,6 +67,7 @@ class V3FileDependImp { const string& filename() const { return m_filename; } bool target() const { return m_target; } off_t size() const { return m_stat.st_size; } + ino_t ino() const { return m_stat.st_ino; } time_t mtime() const { return m_stat.st_mtime; } void loadStats() { if (!m_stat.st_mtime) { @@ -169,10 +170,12 @@ inline void V3FileDependImp::writeTimes(const string& filename, const string& cm V3Options::fileNfsFlush(dfp->filename()); dfp->loadStats(); off_t showSize = iter->size(); - if (dfp->filename() == filename) showSize=0; // We're writing it, so need to ignore it + ino_t showIno = iter->ino(); + if (dfp->filename() == filename) { showSize=0; showIno=0; } // We're writing it, so need to ignore it *ofp<<(iter->target()?"T":"S")<<" "; *ofp<<" "<mtime(); *ofp<<" \""<filename()<<"\""; *ofp<eof()) { char chkDir; *ifp>>chkDir; off_t chkSize; *ifp>>chkSize; + ino_t chkIno; *ifp>>chkIno; if (ifp->eof()) break; // Needed to read final whitespace before found eof time_t chkMtime; *ifp>>chkMtime; char quote; *ifp>>quote; @@ -222,6 +226,7 @@ inline bool V3FileDependImp::checkTimes(const string& filename, const string& cm // we determined the original size. For safety, we know the creation time // must be within a few second window... call it 20 sec. if (!(chkStat.st_size >= chkSize + && chkStat.st_ino == chkIno && chkStat.st_mtime >= chkMtime && chkStat.st_mtime <= (chkMtime + 20))) { UINFO(2," --check-times failed: out-of-date "<