about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/local-fs-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/local-fs-store.cc')
-rw-r--r--third_party/nix/src/libstore/local-fs-store.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/third_party/nix/src/libstore/local-fs-store.cc b/third_party/nix/src/libstore/local-fs-store.cc
index f3ac5b3663ff..9a5ea153869a 100644
--- a/third_party/nix/src/libstore/local-fs-store.cc
+++ b/third_party/nix/src/libstore/local-fs-store.cc
@@ -27,7 +27,7 @@ struct LocalStoreAccessor : public FSAccessor {
     auto realPath = toRealPath(path);
 
     struct stat st;
-    if (lstat(realPath.c_str(), &st)) {
+    if (lstat(realPath.c_str(), &st) != 0) {
       if (errno == ENOENT || errno == ENOTDIR) {
         return {Type::tMissing, 0, false};
       }
@@ -42,7 +42,7 @@ struct LocalStoreAccessor : public FSAccessor {
                 ? Type::tRegular
                 : S_ISLNK(st.st_mode) ? Type::tSymlink : Type::tDirectory,
             S_ISREG(st.st_mode) ? (uint64_t)st.st_size : 0,
-            S_ISREG(st.st_mode) && st.st_mode & S_IXUSR};
+            S_ISREG(st.st_mode) && ((st.st_mode & S_IXUSR) != 0u)};
   }
 
   StringSet readDirectory(const Path& path) override {
@@ -92,7 +92,7 @@ std::shared_ptr<std::string> LocalFSStore::getBuildLog(const Path& path_) {
     } catch (InvalidPath&) {
       return nullptr;
     }
-    if (path == "") {
+    if (path.empty()) {
       return nullptr;
     }
   }
@@ -107,8 +107,8 @@ std::shared_ptr<std::string> LocalFSStore::getBuildLog(const Path& path_) {
 
     if (pathExists(logPath)) {
       return std::make_shared<std::string>(readFile(logPath));
-
-    } else if (pathExists(logBz2Path)) {
+    }
+    if (pathExists(logBz2Path)) {
       try {
         return decompress("bzip2", readFile(logBz2Path));
       } catch (Error&) {