From 0de1110908b09ee2883a70b1789d9916134ad9e5 Mon Sep 17 00:00:00 2001 From: Mateusz Moscicki Date: Wed, 5 Apr 2023 21:23:01 +0200 Subject: [PATCH] Fix aul daemons path The launchpad-process-pool socket path must be "/run/aul/daemons//.launchpad-process-pool-sock". Change-Id: I89e2df902a9b83af863aa13b919e15eea8e942e0 --- src/launchpad-process-pool/launchpad.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/launchpad-process-pool/launchpad.cc b/src/launchpad-process-pool/launchpad.cc index 6885aed..fcc11df 100644 --- a/src/launchpad-process-pool/launchpad.cc +++ b/src/launchpad-process-pool/launchpad.cc @@ -2124,13 +2124,14 @@ static void HandleMemoryStatusChangedEvent(bool low_memory) { namespace launchpad { namespace { +constexpr const char kRunAulDaemonsPath[] = "/run/aul/daemons/"; constexpr const char kLaunchpadProcessPoolSock[] = ".launchpad-process-pool-sock"; const int kReceivedBufferSize = 131071; const int kMaxPendingConnection = 128; int GetLaunchpadFdFromSystemd() { - const std::string path = "/run/aul/daemons/" + std::to_string(getuid()) + + const std::string path = kRunAulDaemonsPath + std::to_string(getuid()) + "/" + std::string(kLaunchpadProcessPoolSock); int fds = sd_listen_fds(0); for (int fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + fds; ++fd) { @@ -2162,7 +2163,7 @@ ServerSocket* GetLaunchpadSocket() { return new ServerSocket(fd); auto* socket = new ServerSocket(); - const std::string endpoint = "/run/aul/daeons/" + std::to_string(getuid()) + + const std::string endpoint = kRunAulDaemonsPath + std::to_string(getuid()) + kLaunchpadProcessPoolSock; socket->Bind(endpoint); socket->SetReceiveBufferSize(kReceivedBufferSize); -- 2.7.4