OSDN Git Service

versioner: fix darwin build.
authorJosh Gao <jmgao@google.com>
Thu, 23 Feb 2017 21:52:49 +0000 (13:52 -0800)
committerJosh Gao <jmgao@google.com>
Thu, 23 Feb 2017 21:52:49 +0000 (13:52 -0800)
Use struct stat::st_mtime instead of the underlying st_mtim, which is
called something different on Darwin.

Test: mma on linux, darwin
Change-Id: I2695a6c83ebb7d08ec56b1355e0f4bc0993a0acb

tools/versioner/src/VFS.cpp

index 1aa7229..cdf232f 100644 (file)
@@ -59,7 +59,7 @@ static void addDirectoryToVFS(InMemoryFileSystem* vfs, const std::string& path)
       errx(1, "failed to map header '%s'", file_path);
     }
 
-    if (!vfs->addFile(file_path, ent->fts_statp->st_mtim.tv_sec, std::move(buffer_opt.get()))) {
+    if (!vfs->addFile(file_path, ent->fts_statp->st_mtime, std::move(buffer_opt.get()))) {
       errx(1, "failed to add file '%s'", file_path);
     }
   }