moving set signal handler to network utils

This commit is contained in:
2025-07-11 10:52:08 +02:00
parent 2698087efa
commit 09709f0f96
7 changed files with 24 additions and 21 deletions

View File

@@ -7,7 +7,6 @@
#include "sls/sls_detector_defs.h"
#include "sls/versionAPI.h"
#include <csignal>
#include <cstring>
#include <unistd.h>
@@ -335,17 +334,6 @@ std::string CommandLineOptions::getHelpMessage() const {
throw sls::RuntimeError("Unknown AppType for help message");
}
void CommandLineOptions::setupSignalHandler(int signal, void (*handler)(int)) {
// Catch signal SIGINT to close files and call destructors properly
struct sigaction sa {};
sa.sa_handler = handler;
sigemptyset(&sa.sa_mask); // dont block additional signals
sa.sa_flags = 0;
if (sigaction(signal, &sa, nullptr) == -1) {
LOG(sls::logERROR) << "Could not set handler for " << strsignal(signal);
}
}
void CommandLineOptions::setEffectiveUID(uid_t uid) {
if (geteuid() == uid) {
LOG(sls::logINFO) << "Process already has the same Effective UID "