From 35724170f8b925a3b4771ebee672bc01a06bd022 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Wed, 13 Aug 2014 22:56:47 +0200 Subject: [PATCH] Make FileLister::browse not log a non-existing directory as an error To avoid unnecessary existence checks, we consider browsing a non-existing directory to be a normal situation. --- src/filelister.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/filelister.cpp b/src/filelister.cpp index 2ba6950..5c6eb2f 100644 --- a/src/filelister.cpp +++ b/src/filelister.cpp @@ -85,7 +85,9 @@ void FileLister::browse(const string& path, bool clean) DIR *dirp; if ((dirp = opendir(slashedPath.c_str())) == NULL) { - ERROR("Unable to open directory: %s\n", slashedPath.c_str()); + if (errno != ENOENT) { + ERROR("Unable to open directory: %s\n", slashedPath.c_str()); + } return; }