about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/legacy-ssh-store.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T19·47+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T19·51+0100
commit39087321811e81e26a1a47d6967df1088dcf0e95 (patch)
tree57110be423eeb7869e9960466f4b17c0ea7cd961 /third_party/nix/src/libstore/legacy-ssh-store.cc
parentcf40d08908ede4061eb15513b770c98877844b8b (diff)
style(3p/nix): Final act in the brace-wrapping saga r/777
This last change set was generated by a full clang-tidy run (including
compilation):

    clang-tidy -p ~/projects/nix-build/ \
      -checks=-*,readability-braces-around-statements -fix src/*/*.cc

Actually running clang-tidy requires some massaging to make it play
nice with Nix + meson, I'll be adding a wrapper or something for that soon.
Diffstat (limited to 'third_party/nix/src/libstore/legacy-ssh-store.cc')
-rw-r--r--third_party/nix/src/libstore/legacy-ssh-store.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/third_party/nix/src/libstore/legacy-ssh-store.cc b/third_party/nix/src/libstore/legacy-ssh-store.cc
index 8510895d0b..0cfe1bfe5d 100644
--- a/third_party/nix/src/libstore/legacy-ssh-store.cc
+++ b/third_party/nix/src/libstore/legacy-ssh-store.cc
@@ -69,12 +69,14 @@ struct LegacySSHStore : public Store {
       conn->to.flush();
 
       unsigned int magic = readInt(conn->from);
-      if (magic != SERVE_MAGIC_2)
+      if (magic != SERVE_MAGIC_2) {
         throw Error("protocol mismatch with 'nix-store --serve' on '%s'", host);
+      }
       conn->remoteVersion = readInt(conn->from);
-      if (GET_PROTOCOL_MAJOR(conn->remoteVersion) != 0x200)
+      if (GET_PROTOCOL_MAJOR(conn->remoteVersion) != 0x200) {
         throw Error("unsupported 'nix-store --serve' protocol version on '%s'",
                     host);
+      }
 
     } catch (EndOfFile& e) {
       throw Error("cannot connect to '%1%'", host);
@@ -160,9 +162,10 @@ struct LegacySSHStore : public Store {
       conn->to.flush();
     }
 
-    if (readInt(conn->from) != 1)
+    if (readInt(conn->from) != 1) {
       throw Error(
           "failed to add path '%s' to remote host '%s', info.path, host");
+    }
   }
 
   void narFromPath(const Path& path, Sink& sink) override {
@@ -194,10 +197,12 @@ struct LegacySSHStore : public Store {
 
     conn->to << cmdBuildDerivation << drvPath << drv << settings.maxSilentTime
              << settings.buildTimeout;
-    if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 2)
+    if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 2) {
       conn->to << settings.maxLogSize;
-    if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 3)
+    }
+    if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 3) {
       conn->to << settings.buildRepeat << settings.enforceDeterminism;
+    }
 
     conn->to.flush();
 
@@ -205,9 +210,10 @@ struct LegacySSHStore : public Store {
     status.status = (BuildResult::Status)readInt(conn->from);
     conn->from >> status.errorMsg;
 
-    if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 3)
+    if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 3) {
       conn->from >> status.timesBuilt >> status.isNonDeterministic >>
           status.startTime >> status.stopTime;
+    }
 
     return status;
   }