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 "actions.h"
#include "../app.h"
#include "../signals.h"
#include <signal.h>
using namespace falco::app;
using namespace falco::app::actions;

View File

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

View File

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

View File

@ -28,10 +28,10 @@ class falco_webserver
public:
falco_webserver() = default;
virtual ~falco_webserver();
falco_webserver(falco_webserver&&) = default;
falco_webserver& operator = (falco_webserver&&) = default;
falco_webserver(const falco_webserver&) = delete;
falco_webserver& operator = (const falco_webserver&) = delete;
falco_webserver(falco_webserver&&) = default;
falco_webserver& operator = (falco_webserver&&) = default;
falco_webserver(const falco_webserver&) = delete;
falco_webserver& operator = (const falco_webserver&) = delete;
virtual void start(
const std::shared_ptr<sinsp>& inspector,
uint32_t threadiness,