summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFredrik Medley <fredrik.medley@autoliv.com>2018-04-09 19:27:31 (GMT)
committerFredrik Medley <fredrik.medley@autoliv.com>2018-04-09 19:46:07 (GMT)
commit49626c3610826a49f5fa7aee139415fe03d650fd (patch)
tree0fe20b7a9e149bb1acafdb7f53632eb717e1657d /src
parent265a6eaf399778c746c7d2c02b8742f3c0ff07e9 (diff)
downloadNinja-49626c3610826a49f5fa7aee139415fe03d650fd.zip
Ninja-49626c3610826a49f5fa7aee139415fe03d650fd.tar.gz
Ninja-49626c3610826a49f5fa7aee139415fe03d650fd.tar.bz2
Revert "Fix stat when subdirectory is a file"
This reverts commit 6c864097ef11da366fb4070e6ab9f34d6a293766 and fixes the broken Appveyor builds on GitHub.
Diffstat (limited to 'src')
-rw-r--r--src/disk_interface.cc3
-rw-r--r--src/disk_interface_test.cc21
2 files changed, 1 insertions, 23 deletions
diff --git a/src/disk_interface.cc b/src/disk_interface.cc
index 8334d69..504c679 100644
--- a/src/disk_interface.cc
+++ b/src/disk_interface.cc
@@ -105,8 +105,7 @@ bool StatAllFilesInDir(const string& dir, map<string, TimeStamp>* stamps,
if (find_handle == INVALID_HANDLE_VALUE) {
DWORD win_err = GetLastError();
- if (win_err == ERROR_FILE_NOT_FOUND || win_err == ERROR_PATH_NOT_FOUND ||
- win_err == ERROR_DIRECTORY) // File and not a directory
+ if (win_err == ERROR_FILE_NOT_FOUND || win_err == ERROR_PATH_NOT_FOUND)
return true;
*err = "FindFirstFileExA(" + dir + "): " + GetLastErrorString();
return false;
diff --git a/src/disk_interface_test.cc b/src/disk_interface_test.cc
index 5f7e468..81aa63a 100644
--- a/src/disk_interface_test.cc
+++ b/src/disk_interface_test.cc
@@ -63,27 +63,6 @@ TEST_F(DiskInterfaceTest, StatMissingFile) {
EXPECT_EQ("", err);
}
-#ifdef _WIN32
-TEST_F(DiskInterfaceTest, StatMissingFileWithCache) {
- string err;
- disk_.AllowStatCache(true);
-
- EXPECT_EQ(0, disk_.Stat("nosuchfile", &err));
- EXPECT_EQ("", err);
-
- // On Windows, the errno for a file in a nonexistent directory
- // is different.
- EXPECT_EQ(0, disk_.Stat("nosuchdir/nosuchfile", &err));
- EXPECT_EQ("", err);
-
- // On POSIX systems, the errno is different if a component of the
- // path prefix is not a directory.
- ASSERT_TRUE(Touch("notadir"));
- EXPECT_EQ(0, disk_.Stat("notadir/nosuchfile", &err));
- EXPECT_EQ("", err);
-}
-#endif
-
TEST_F(DiskInterfaceTest, StatBadPath) {
string err;
#ifdef _WIN32