From 0fae54dcd626e5c9e081ffd3f794361aa2ae7c2b Mon Sep 17 00:00:00 2001 From: shawnz Date: Tue, 16 Sep 2025 17:29:36 +0800 Subject: [PATCH] Bug 5514725: Modify the socket folder for systems that have GCC < 8 by default such as SLES --- Common/helper_multiprocess.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Common/helper_multiprocess.h b/Common/helper_multiprocess.h index 2c09b5e3..a6ecb13c 100644 --- a/Common/helper_multiprocess.h +++ b/Common/helper_multiprocess.h @@ -52,12 +52,22 @@ #include #include #endif -#include #include -inline std::string getSocketFolder() { - return std::filesystem::temp_directory_path().string(); -} +// Simple filesystem compatibility for GCC 7.x +#if defined(__GNUC__) && __GNUC__ < 8 + #include + #include + inline std::string getSocketFolder() { + const char* tmpdir = std::getenv("TMPDIR"); + return tmpdir ? std::string(tmpdir) : "/tmp"; + } +#else + #include + inline std::string getSocketFolder() { + return std::filesystem::temp_directory_path().string(); + } +#endif typedef struct sharedMemoryInfo_st { void *addr;