aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-12 19:31:42 +0200
committerDan Engelbrecht <[email protected]>2022-04-12 19:31:42 +0200
commit27e49ea3a4770c268a01e503bd3f186568059636 (patch)
tree87bb21010de98d8fb281ed60b2c54567eadba6da
parentcleanup (diff)
downloadzen-27e49ea3a4770c268a01e503bd3f186568059636.tar.xz
zen-27e49ea3a4770c268a01e503bd3f186568059636.zip
more cleanup
-rw-r--r--zencore/filesystem.cpp4
-rw-r--r--zencore/include/zencore/filesystem.h2
-rw-r--r--zenserver/zenserver.cpp10
-rw-r--r--zenstore-test/zenstore-test.cpp3
4 files changed, 8 insertions, 11 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index 8e75ad773..7ff0dc45c 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -23,6 +23,7 @@
#if ZEN_PLATFORM_LINUX
# include <dirent.h>
# include <fcntl.h>
+# include <sys/resource.h>
# include <sys/stat.h>
# include <unistd.h>
#endif
@@ -31,6 +32,7 @@
# include <dirent.h>
# include <fcntl.h>
# include <libproc.h>
+# include <sys/resource.h>
# include <sys/stat.h>
# include <sys/syslimits.h>
# include <unistd.h>
@@ -987,7 +989,7 @@ GetRunningExecutablePath()
}
void
-InitializeOpenFileCount()
+MaximizeOpenFileCount()
{
#if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
struct rlimit Limit;
diff --git a/zencore/include/zencore/filesystem.h b/zencore/include/zencore/filesystem.h
index 98d2897cf..a6e76eaa0 100644
--- a/zencore/include/zencore/filesystem.h
+++ b/zencore/include/zencore/filesystem.h
@@ -36,7 +36,7 @@ ZENCORE_API std::filesystem::path GetRunningExecutablePath();
/** Set the max open file handle count to max allowed for the current process on Linux and MacOS
*/
-ZENCORE_API void InitializeOpenFileCount();
+ZENCORE_API void MaximizeOpenFileCount();
struct FileContents
{
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 85d62c9f6..3ac5b9992 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -25,12 +25,6 @@
# include <zencore/windows.h>
#endif
-#if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
-# include <sys/time.h>
-# include <sys/resource.h>
-# include <zencore/except.h>
-#endif
-
#if ZEN_USE_MIMALLOC
ZEN_THIRD_PARTY_INCLUDES_START
# include <mimalloc-new-delete.h>
@@ -1024,7 +1018,7 @@ ZenEntryPoint::Run()
InitializeLogging(ServerOptions);
- zen::InitializeOpenFileCount();
+ MaximizeOpenFileCount();
ZEN_INFO(ZEN_APP_NAME " - using lock file at '{}'", LockFilePath);
@@ -1166,7 +1160,7 @@ test_main(int argc, char** argv)
zen::logging::InitializeLogging();
spdlog::set_level(spdlog::level::debug);
- zen::InitializeOpenFileCount();
+ zen::MaximizeOpenFileCount();
return doctest::Context(argc, argv).run();
}
diff --git a/zenstore-test/zenstore-test.cpp b/zenstore-test/zenstore-test.cpp
index 704470f8e..030b1159d 100644
--- a/zenstore-test/zenstore-test.cpp
+++ b/zenstore-test/zenstore-test.cpp
@@ -1,6 +1,7 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include <zencore/logging.h>
+#include <zencore/filesystem.h>
#include <zencore/zencore.h>
#include <zenstore/zenstore.h>
@@ -23,7 +24,7 @@ main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
zen::zenstore_forcelinktests();
zen::logging::InitializeLogging();
- zen::InitializeOpenFileCount();
+ zen::MaximizeOpenFileCount();
return doctest::Context(argc, argv).run();
#else