diff options
author | Evan Martin <martine@danga.com> | 2013-05-16 23:23:29 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2013-05-16 23:23:29 (GMT) |
commit | ddb21217f90e2fc6639d68b240ad2fc394b2dc6c (patch) | |
tree | b72aa49307eb6d4e9fd0781ae3202261b127c4e8 /src/disk_interface.cc | |
parent | d0d199e99fe6648c3994ecbbe0c7927065b22d16 (diff) | |
parent | 31ef1415f208e04000424e6fc446fe4377bc7ed3 (diff) | |
download | Ninja-ddb21217f90e2fc6639d68b240ad2fc394b2dc6c.zip Ninja-ddb21217f90e2fc6639d68b240ad2fc394b2dc6c.tar.gz Ninja-ddb21217f90e2fc6639d68b240ad2fc394b2dc6c.tar.bz2 |
Merge branch 'master' into release
Diffstat (limited to 'src/disk_interface.cc')
-rw-r--r-- | src/disk_interface.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/disk_interface.cc b/src/disk_interface.cc index 7c557cd..ee3e99a 100644 --- a/src/disk_interface.cc +++ b/src/disk_interface.cc @@ -80,8 +80,10 @@ TimeStamp RealDiskInterface::Stat(const string& path) { // MSDN: "Naming Files, Paths, and Namespaces" // http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx if (!path.empty() && path[0] != '\\' && path.size() > MAX_PATH) { - Error("Stat(%s): Filename longer than %i characters", - path.c_str(), MAX_PATH); + if (!quiet_) { + Error("Stat(%s): Filename longer than %i characters", + path.c_str(), MAX_PATH); + } return -1; } WIN32_FILE_ATTRIBUTE_DATA attrs; @@ -89,8 +91,10 @@ TimeStamp RealDiskInterface::Stat(const string& path) { DWORD err = GetLastError(); if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND) return 0; - Error("GetFileAttributesEx(%s): %s", path.c_str(), - GetLastErrorString().c_str()); + if (!quiet_) { + Error("GetFileAttributesEx(%s): %s", path.c_str(), + GetLastErrorString().c_str()); + } return -1; } const FILETIME& filetime = attrs.ftLastWriteTime; @@ -107,7 +111,9 @@ TimeStamp RealDiskInterface::Stat(const string& path) { if (stat(path.c_str(), &st) < 0) { if (errno == ENOENT || errno == ENOTDIR) return 0; - Error("stat(%s): %s", path.c_str(), strerror(errno)); + if (!quiet_) { + Error("stat(%s): %s", path.c_str(), strerror(errno)); + } return -1; } return st.st_mtime; |