2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 22:15:23 +00:00

[#1097] Addresses review comments

Minor cleanups
This commit is contained in:
Thomas Markwalder
2020-02-04 09:35:48 -05:00
parent cd7b2807f4
commit 86d384da7a
2 changed files with 2 additions and 5 deletions

View File

@@ -490,7 +490,7 @@ public:
/// @brief Returns the lock file name /// @brief Returns the lock file name
std::string getLockName() { std::string getLockName() {
return(std::string(socket_name_ + ".lock")); return (std::string(socket_name_ + ".lock"));
} }
/// @brief Pointer to the IO service used by the server process for running /// @brief Pointer to the IO service used by the server process for running
@@ -549,7 +549,6 @@ CommandMgrImpl::openCommandSocket(const isc::data::ConstElementPtr& socket_info)
// First let's open lock file. // First let's open lock file.
std::string lock_name = getLockName(); std::string lock_name = getLockName();
errno = 0;
int lock_fd = open(lock_name.c_str(), O_RDONLY | O_CREAT, 0600); int lock_fd = open(lock_name.c_str(), O_RDONLY | O_CREAT, 0600);
if (lock_fd == -1) { if (lock_fd == -1) {
std::string errmsg = strerror(errno); std::string errmsg = strerror(errno);
@@ -559,7 +558,6 @@ CommandMgrImpl::openCommandSocket(const isc::data::ConstElementPtr& socket_info)
// Try to acquire lock. If we can't somebody else is actively // Try to acquire lock. If we can't somebody else is actively
// using it. // using it.
errno = 0;
int ret = flock(lock_fd, LOCK_EX | LOCK_NB); int ret = flock(lock_fd, LOCK_EX | LOCK_NB);
if (ret != 0) { if (ret != 0) {
std::string errmsg = strerror(errno); std::string errmsg = strerror(errno);
@@ -568,7 +566,7 @@ CommandMgrImpl::openCommandSocket(const isc::data::ConstElementPtr& socket_info)
} }
// We have the lock, so let's remove the pre-existing socket // We have the lock, so let's remove the pre-existing socket
// file if it's exists. // file if it exists.
static_cast<void>(::remove(socket_name_.c_str())); static_cast<void>(::remove(socket_name_.c_str()));
LOG_INFO(command_logger, COMMAND_ACCEPTOR_START) LOG_INFO(command_logger, COMMAND_ACCEPTOR_START)

View File

@@ -17,7 +17,6 @@
#include <hooks/hooks_manager.h> #include <hooks/hooks_manager.h>
#include <hooks/callout_handle.h> #include <hooks/callout_handle.h>
#include <hooks/library_handle.h> #include <hooks/library_handle.h>
#include <testutils/gtest_utils.h>
#include <string> #include <string>
#include <vector> #include <vector>