get_listen_fds -> get_listen_fd

This commit is contained in:
Ovv 2025-11-01 11:09:49 +01:00
parent 8606ff060a
commit 2619f4e61d
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@
#include <unistd.h>
#include <string>
int get_listen_fds()
int get_listen_fd()
{
char* const listen_pid = std::getenv("LISTEN_PID");
char* const listen_fds = std::getenv("LISTEN_FDS");
@ -44,7 +44,7 @@ int get_listen_fds()
}
#else
// On non-Linux systems, just return 0 (no socket activation)
int get_listen_fds()
int get_listen_fd()
{
return 0;
}

View File

@ -18,6 +18,6 @@
#ifndef _SYSTEMD_H_
#define _SYSTEMD_H_
int get_listen_fds();
int get_listen_fd();
#endif

View File

@ -39,7 +39,7 @@ public:
_socket(ioContext), _closed(false), _socketFactory([this](){ return DefaultSocketFactory(); }),
_supportSocketActivation(supportSocketActivation)
{
int const listen_fd = get_listen_fds();
int const listen_fd = get_listen_fd();
if (_supportSocketActivation && listen_fd > 0)
{
LOG_DEBUG("network", "Using socket from systemd socket activation");