Skip to content

Commit

Permalink
Apply some missing formatting and unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
Molter73 committed Sep 18, 2024
1 parent 41a295b commit 3429431
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion collector/lib/CollectorStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CollectorStats {

std::array<std::atomic<int64_t>, counter_type_max> counter_ = {{}};

CollectorStats(){};
CollectorStats() {};
};

template <typename T>
Expand Down
3 changes: 1 addition & 2 deletions collector/lib/DuplexGRPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,7 @@ class DuplexClientReaderWriter : public DuplexClientWriter<W> {
// Shutdown the client and drain the queue.
this->Shutdown(); // ignore errors
auto now = ToDeadline(time_point::min());
while (ProcessSingle(nullptr, now, nullptr))
;
while (ProcessSingle(nullptr, now, nullptr));
}

template <typename TS = time_point>
Expand Down
3 changes: 1 addition & 2 deletions collector/lib/ProcfsScraper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ const char* nextfield(const char* p, const char* endp) {
while (p < endp && *p && !std::isspace(*p)) {
p++;
}
while (p < endp && *p && std::isspace(*++p))
;
while (p < endp && *p && std::isspace(*++p));
return (p < endp && *p) ? p : nullptr;
}

Expand Down
3 changes: 1 addition & 2 deletions collector/lib/SignalServiceClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ bool SignalServiceClient::EstablishGRPCStreamSingle() {
}

void SignalServiceClient::EstablishGRPCStream() {
while (EstablishGRPCStreamSingle())
;
while (EstablishGRPCStreamSingle());
CLOG(INFO) << "Signal service client terminating.";
}

Expand Down
4 changes: 2 additions & 2 deletions collector/lib/SignalServiceClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class StdoutSignalServiceClient : public ISignalServiceClient {

explicit StdoutSignalServiceClient() {}

void Start(){};
void Stop(){};
void Start() {};
void Stop() {};

SignalHandler::Result PushSignals(const SignalStreamMessage& msg);
};
Expand Down
2 changes: 1 addition & 1 deletion collector/test/HostHeuristicsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MockHostInfoHeuristics : public HostInfo {
class MockCollectorConfig : public CollectorConfig {
public:
MockCollectorConfig()
: CollectorConfig(){};
: CollectorConfig() {};

void SetCollectionMethod(CollectionMethod cm) {
if (host_config_.HasCollectionMethod()) {
Expand Down
10 changes: 5 additions & 5 deletions integration-tests/container/perf/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ check_headers() {
return 0
}

if [[ "$(sysctl -n kernel.kptr_restrict)" != "0" ]]; then
# If this is not zero, it can interfere with most of the tools
sysctl -w kernel.kptr_restrict=0
fi

if [[ ! -e "/lib/modules/.installed" ]]; then
if check_headers "${HOST_MODULES_DIR}"; then
HEADERS_TARGET="${HOST_MODULES_DIR}/source"
Expand All @@ -139,8 +144,3 @@ else
echo "Headers already installed"
exit 0
fi

if [[ "$(sysctl -n kernel.kptr_restrict)" != "0" ]]; then
# If this is not zero, it can interfere with most of the tools
sysctl -w kernel.kptr_restrict=0
fi

0 comments on commit 3429431

Please sign in to comment.