aboutsummaryrefslogtreecommitdiff
path: root/gold/fileread.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-11-06 15:47:06 +0000
committerIan Lance Taylor <ian@airs.com>2009-11-06 15:47:06 +0000
commit5d329b7db9afec533616070131d7bde5fe4b71fa (patch)
treebd5989a99f82204242b7612863579103c332f219 /gold/fileread.cc
parentdec397b2dec7738549bcb998dd64df8946bbd0d1 (diff)
downloadgdb-5d329b7db9afec533616070131d7bde5fe4b71fa.zip
gdb-5d329b7db9afec533616070131d7bde5fe4b71fa.tar.gz
gdb-5d329b7db9afec533616070131d7bde5fe4b71fa.tar.bz2
* configure.ac: Check for (struct stat)::st_mtim
* fileread.cc (File_read::get_mtime): Use st_mtim if available. * config.in: Regenerate. * configure: Regenerate.
Diffstat (limited to 'gold/fileread.cc')
-rw-r--r--gold/fileread.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/fileread.cc b/gold/fileread.cc
index d183c57..ac30769 100644
--- a/gold/fileread.cc
+++ b/gold/fileread.cc
@@ -823,9 +823,11 @@ File_read::get_mtime()
if (fstat(this->descriptor_, &file_stat) < 0)
gold_fatal(_("%s: stat failed: %s"), this->name_.c_str(),
strerror(errno));
- // TODO: do a configure check if st_mtim is present and get the
- // nanoseconds part if it is.
+#ifdef HAVE_STAT_ST_MTIM
+ return Timespec(file_stat.st_mtim.tv_sec, file_stat.st_mtim.tv_nsec);
+#else
return Timespec(file_stat.st_mtime, 0);
+#endif
}
// Open the file.