aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libmain/progress-bar.cc3
-rw-r--r--src/libstore/build/local-derivation-goal.hh4
-rw-r--r--src/libstore/build/substitution-goal.hh3
-rw-r--r--src/libstore/filetransfer.cc2
-rw-r--r--src/libutil/args.cc2
-rw-r--r--src/libutil/logging.cc2
6 files changed, 11 insertions, 5 deletions
diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc
index 6600ec177..45b1fdfd1 100644
--- a/src/libmain/progress-bar.cc
+++ b/src/libmain/progress-bar.cc
@@ -108,7 +108,8 @@ public:
stop();
}
- void stop() override
+ /* Called by destructor, can't be overridden */
+ void stop() override final
{
{
auto state(state_.lock());
diff --git a/src/libstore/build/local-derivation-goal.hh b/src/libstore/build/local-derivation-goal.hh
index 9acd7593d..8827bfca3 100644
--- a/src/libstore/build/local-derivation-goal.hh
+++ b/src/libstore/build/local-derivation-goal.hh
@@ -272,8 +272,10 @@ struct LocalDerivationGoal : public DerivationGoal
/**
* Forcibly kill the child process, if any.
+ *
+ * Called by destructor, can't be overridden
*/
- void killChild() override;
+ void killChild() override final;
/**
* Kill any processes running under the build user UID or in the
diff --git a/src/libstore/build/substitution-goal.hh b/src/libstore/build/substitution-goal.hh
index 9fc041920..1b693baa1 100644
--- a/src/libstore/build/substitution-goal.hh
+++ b/src/libstore/build/substitution-goal.hh
@@ -114,7 +114,8 @@ public:
void handleChildOutput(int fd, std::string_view data) override;
void handleEOF(int fd) override;
- void cleanup() override;
+ /* Called by destructor, can't be overridden */
+ void cleanup() override final;
JobCategory jobCategory() override { return JobCategory::Substitution; };
};
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index 38b691279..a283af5a2 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -863,6 +863,8 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
}
chunk = std::move(state->data);
+ /* Reset state->data after the move, since we check data.empty() */
+ state->data = "";
state->request.notify_one();
}
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 3cf3ed9ca..00281ce6f 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -410,8 +410,8 @@ nlohmann::json MultiCommand::toJSON()
auto cat = nlohmann::json::object();
cat["id"] = command->category();
cat["description"] = trim(categories[command->category()]);
- j["category"] = std::move(cat);
cat["experimental-feature"] = command->experimentalFeature();
+ j["category"] = std::move(cat);
cmds[name] = std::move(j);
}
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 5a2dd99af..54702e4ea 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -67,7 +67,7 @@ public:
case lvlWarn: c = '4'; break;
case lvlNotice: case lvlInfo: c = '5'; break;
case lvlTalkative: case lvlChatty: c = '6'; break;
- case lvlDebug: case lvlVomit: c = '7';
+ case lvlDebug: case lvlVomit: c = '7'; break;
default: c = '7'; break; // should not happen, and missing enum case is reported by -Werror=switch-enum
}
prefix = std::string("<") + c + ">";