Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fix Failed to stat error w/ LoadFromFile ngx#972
If you turn on LoadFromFile then 404s turn into errors in the log. These
shouldn't be errors, so don't log unless we see an errno which isn't ENOENT.
  • Loading branch information
crowell committed May 29, 2015
1 parent cf5ba4e commit 3d44cc7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pagespeed/kernel/base/stdio_file_system.cc
Expand Up @@ -423,11 +423,12 @@ bool StdioFileSystem::Stat(const StringPiece& path, struct stat* statbuf,
const char* path_str = path_string.c_str();
if (stat(path_str, statbuf) == 0) {
return true;
} else {
handler->Message(kError, "Failed to stat %s: %s",
path_str, strerror(errno));
return false;
} else if (errno != ENOENT) { // Not an error if file doesn't exist see #972.
// https://github.com/pagespeed/ngx_pagespeed/issues/972
handler->Message(kError, "Failed to stat %s: %s", path_str,
strerror(errno));
}
return false;
}

// TODO(abliss): there are some situations where this doesn't work
Expand Down

0 comments on commit 3d44cc7

Please sign in to comment.