forked from github/verilator
Fix --skip-identical mis-detecting on OS-X, bug707.
This commit is contained in:
parent
97633f7bed
commit
88af0d3509
2
Changes
2
Changes
@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
|||||||
|
|
||||||
**** Fix array bound checks on real variables.
|
**** Fix array bound checks on real variables.
|
||||||
|
|
||||||
|
**** Fix --skip-identical mis-detecting on OS-X, bug707.
|
||||||
|
|
||||||
|
|
||||||
* Verilator 3.855 2014-01-18
|
* Verilator 3.855 2014-01-18
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ class V3FileDependImp {
|
|||||||
const string& filename() const { return m_filename; }
|
const string& filename() const { return m_filename; }
|
||||||
bool target() const { return m_target; }
|
bool target() const { return m_target; }
|
||||||
off_t size() const { return m_stat.st_size; }
|
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; }
|
time_t mtime() const { return m_stat.st_mtime; }
|
||||||
void loadStats() {
|
void loadStats() {
|
||||||
if (!m_stat.st_mtime) {
|
if (!m_stat.st_mtime) {
|
||||||
@ -169,10 +170,12 @@ inline void V3FileDependImp::writeTimes(const string& filename, const string& cm
|
|||||||
V3Options::fileNfsFlush(dfp->filename());
|
V3Options::fileNfsFlush(dfp->filename());
|
||||||
dfp->loadStats();
|
dfp->loadStats();
|
||||||
off_t showSize = iter->size();
|
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<<(iter->target()?"T":"S")<<" ";
|
||||||
*ofp<<" "<<setw(8)<<showSize;
|
*ofp<<" "<<setw(8)<<showSize;
|
||||||
|
*ofp<<" "<<setw(8)<<showIno;
|
||||||
*ofp<<" "<<setw(11)<<iter->mtime();
|
*ofp<<" "<<setw(11)<<iter->mtime();
|
||||||
*ofp<<" \""<<iter->filename()<<"\"";
|
*ofp<<" \""<<iter->filename()<<"\"";
|
||||||
*ofp<<endl;
|
*ofp<<endl;
|
||||||
@ -202,6 +205,7 @@ inline bool V3FileDependImp::checkTimes(const string& filename, const string& cm
|
|||||||
while (!ifp->eof()) {
|
while (!ifp->eof()) {
|
||||||
char chkDir; *ifp>>chkDir;
|
char chkDir; *ifp>>chkDir;
|
||||||
off_t chkSize; *ifp>>chkSize;
|
off_t chkSize; *ifp>>chkSize;
|
||||||
|
ino_t chkIno; *ifp>>chkIno;
|
||||||
if (ifp->eof()) break; // Needed to read final whitespace before found eof
|
if (ifp->eof()) break; // Needed to read final whitespace before found eof
|
||||||
time_t chkMtime; *ifp>>chkMtime;
|
time_t chkMtime; *ifp>>chkMtime;
|
||||||
char quote; *ifp>>quote;
|
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
|
// we determined the original size. For safety, we know the creation time
|
||||||
// must be within a few second window... call it 20 sec.
|
// must be within a few second window... call it 20 sec.
|
||||||
if (!(chkStat.st_size >= chkSize
|
if (!(chkStat.st_size >= chkSize
|
||||||
|
&& chkStat.st_ino == chkIno
|
||||||
&& chkStat.st_mtime >= chkMtime
|
&& chkStat.st_mtime >= chkMtime
|
||||||
&& chkStat.st_mtime <= (chkMtime + 20))) {
|
&& chkStat.st_mtime <= (chkMtime + 20))) {
|
||||||
UINFO(2," --check-times failed: out-of-date "<<chkFilename
|
UINFO(2," --check-times failed: out-of-date "<<chkFilename
|
||||||
|
Loading…
Reference in New Issue
Block a user