]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1464] Addressed comments
authorFrancis Dupont <fdupont@isc.org>
Fri, 9 Oct 2020 14:00:57 +0000 (16:00 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 9 Oct 2020 14:11:16 +0000 (14:11 +0000)
src/lib/dhcpsrv/tests/host_mgr_unittest.cc
src/lib/dhcpsrv/tests/test_utils.cc
src/lib/dhcpsrv/tests/test_utils.h

index c06c21b5f9216d9af8eecd91a8cf02c17af5bc4c..7d1051feaff06a74cc53327346136395603d286f 100644 (file)
@@ -1448,7 +1448,7 @@ HostMgrDbLostCallbackTest::testDbLostCallback() {
     int last_open_socket = findLastSocketFd();
 
     // Fill holes.
-    fillFdHoles holes(last_open_socket);
+    FillFdHoles holes(last_open_socket);
 
     // Connect to the host backend.
     ASSERT_NO_THROW(HostMgr::addBackend(validConnectString()));
index c15f759f76fc0d1f3cc8aa26b50190adcfdd576b..4fe7d86d9316ef1d43ae8af1b03290dc5ec9f323 100644 (file)
@@ -123,7 +123,7 @@ int findLastSocketFd() {
     return (last_socket);
 }
 
-fillFdHoles::fillFdHoles(int limit) : fds_() {
+FillFdHoles::FillFdHoles(int limit) : fds_() {
     if (limit <= 0) {
         return;
     }
@@ -141,7 +141,7 @@ fillFdHoles::fillFdHoles(int limit) : fds_() {
     }
 }
 
-fillFdHoles::~fillFdHoles() {
+FillFdHoles::~FillFdHoles() {
     while (!fds_.empty()) {
         static_cast<void>(close(fds_.back()));
         fds_.pop_back();
index 0f2d44f3c380557316be909d4969e78b93fb9010..02af9ba467a7b9438741e91d04adfb716ae733a1 100644 (file)
@@ -57,17 +57,22 @@ int findLastSocketFd();
 /// This tool detects and fills such holes. It uses the RAII idiom to avoid
 /// file descriptor leaks: the destructor called when the object goes out
 /// of scope closes all file descriptors which were opened by the constructor.
-class fillFdHoles {
+class FillFdHoles {
 public:
     /// @brief Constructor
     ///
+    /// Holes between 0 and the specified limit will be filled by opening
+    /// the null device. Typically the limit argument is the result of
+    /// a previous call to @ref findLastSocketFd. Note if the limit is
+    /// 0 or negative the constructor returns doing nothing.
+    ///
     /// @param limit Holes will be filled up to this limit
-    fillFdHoles(int limit);
+    FillFdHoles(int limit);
 
     /// @brief Destructor
     ///
     /// The destructor closes members of the list
-    ~fillFdHoles();
+    ~FillFdHoles();
 
 private:
     /// @brief The list of holes