Skip to content

Commit

Permalink
fix: removes missplaced LogCritical
Browse files Browse the repository at this point in the history
  • Loading branch information
aritosteles committed Nov 4, 2024
1 parent da34d9c commit 65ea228
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/agent/src/unix_daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ namespace unix_daemon

if (!file.is_open())
{
LogCritical("Error opening file: {}({}) {}", filename.c_str(), errno, std::strerror(errno));
return 0;
}

Expand Down
8 changes: 8 additions & 0 deletions src/agent/src/unix_daemon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace unix_daemon
{
/// @brief A class for handling PID files.
class PIDFileHandler
{
public:
Expand All @@ -25,9 +26,16 @@ namespace unix_daemon
bool writePIDFile() const;
bool removePIDFile() const;

/// @brief The method uses the readlink() function to read the path of the current executable file.
/// @return A string representing the current process' executable path.
static std::string GetExecutablePath();
};

/// @brief Returns the current status of the daemon.
/// @return A string representing the daemon's status.
std::string GetDaemonStatus();

/// @brief Generates a PID file for the daemon.
/// @return A PIDFileHandler object that will delete the generated PID file on destruction (RAII style).
PIDFileHandler GeneratePIDFile();
} // namespace unix_daemon

0 comments on commit 65ea228

Please sign in to comment.