diff --git a/cmds/statsd/src/shell/ShellSubscriber.cpp b/cmds/statsd/src/shell/ShellSubscriber.cpp index 6fa165475029c..c677222f31eb4 100644 --- a/cmds/statsd/src/shell/ShellSubscriber.cpp +++ b/cmds/statsd/src/shell/ShellSubscriber.cpp @@ -41,7 +41,7 @@ void ShellSubscriber::startNewSubscription(int in, int out, int timeoutSec) { // critical-section std::unique_lock lock(mMutex); - if (myToken < mToken) { + if (myToken != mToken) { // Some other subscription has already come in. Stop. return; } diff --git a/cmds/statsd/src/shell/ShellSubscriber.h b/cmds/statsd/src/shell/ShellSubscriber.h index 7fd625e472b40..2f9b61a257a8b 100644 --- a/cmds/statsd/src/shell/ShellSubscriber.h +++ b/cmds/statsd/src/shell/ShellSubscriber.h @@ -108,7 +108,7 @@ private: std::shared_ptr mSubscriptionInfo = nullptr; - int mToken; + int mToken = 0; }; } // namespace statsd