update(userspace/falco): minor compilation improvements

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce 2023-02-22 16:30:37 +00:00 committed by poiana
parent 647441c06c
commit 3f69d46f9a
4 changed files with 15 additions and 14 deletions

View File

@ -16,11 +16,12 @@ limitations under the License.
#include <functional> #include <functional>
#include "actions.h" #include "actions.h"
#include "../app.h" #include "../app.h"
#include "../signals.h" #include "../signals.h"
#include <signal.h>
using namespace falco::app; using namespace falco::app;
using namespace falco::app::actions; using namespace falco::app::actions;

View File

@ -20,6 +20,7 @@ limitations under the License.
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h>
#include <sys/inotify.h> #include <sys/inotify.h>
#include <sys/select.h> #include <sys/select.h>
@ -28,6 +29,12 @@ limitations under the License.
#define gettid() syscall(SYS_gettid) #define gettid() syscall(SYS_gettid)
#endif #endif
falco::app::restart_handler::~restart_handler()
{
close(m_inotify_fd);
stop();
}
void falco::app::restart_handler::trigger() void falco::app::restart_handler::trigger()
{ {
m_forced.store(true, std::memory_order_release); m_forced.store(true, std::memory_order_release);

View File

@ -22,8 +22,6 @@ limitations under the License.
#include <string> #include <string>
#include <functional> #include <functional>
#include <unistd.h>
namespace falco namespace falco
{ {
namespace app namespace app
@ -57,13 +55,7 @@ public:
m_on_check(on_check), m_on_check(on_check),
m_watched_dirs(watch_dirs), m_watched_dirs(watch_dirs),
m_watched_files(watch_files) { } m_watched_files(watch_files) { }
virtual ~restart_handler();
virtual ~restart_handler()
{
close(m_inotify_fd);
stop();
}
restart_handler(restart_handler&&) = default; restart_handler(restart_handler&&) = default;
restart_handler& operator = (restart_handler&&) = default; restart_handler& operator = (restart_handler&&) = default;
restart_handler(const restart_handler&) = delete; restart_handler(const restart_handler&) = delete;
@ -84,5 +76,6 @@ private:
watch_list_t m_watched_dirs; watch_list_t m_watched_dirs;
watch_list_t m_watched_files; watch_list_t m_watched_files;
}; };
}; // namespace app }; // namespace app
}; // namespace falco }; // namespace falco