diff options
author | Francis Dupont <fdupont@isc.org> | 2024-09-01 22:45:03 +0200 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2024-09-20 14:55:54 +0200 |
commit | b7790017265585614278d4c09a515b7f6bd21346 (patch) | |
tree | eb85c0973470af7e7e9866cc0276f2867b82e2db /src/lib/config/unix_command_mgr.cc | |
parent | [#3506] Improved UNIX code (diff) | |
download | kea-b7790017265585614278d4c09a515b7f6bd21346.tar.xz kea-b7790017265585614278d4c09a515b7f6bd21346.zip |
[#3506] Close lock file descriptor
Diffstat (limited to '')
-rw-r--r-- | src/lib/config/unix_command_mgr.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/config/unix_command_mgr.cc b/src/lib/config/unix_command_mgr.cc index e83bb549dd..221786e29b 100644 --- a/src/lib/config/unix_command_mgr.cc +++ b/src/lib/config/unix_command_mgr.cc @@ -573,6 +573,9 @@ UnixCommandMgrImpl::openCommandSocket(const isc::data::ConstElementPtr& socket_i // First let's open lock file. std::string lock_name = getLockName(); + if (lock_fd_ != 1) { + close(lock_fd_); + } lock_fd_ = open(lock_name.c_str(), O_RDONLY | O_CREAT, 0600); if (lock_fd_ == -1) { std::string errmsg = strerror(errno); |