summaryrefslogtreecommitdiff
path: root/benchmarks/mangohud/files/patch-src_file__utils.cpp
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2021-12-14 05:15:24 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2021-12-14 05:15:24 +0000
commit9d20c9a6b3e5a561abff0bf131c9025b555bf133 (patch)
tree469562c42a83723ea975662d62983110441560ca /benchmarks/mangohud/files/patch-src_file__utils.cpp
parentdatabases/arrow: Update 4.0.1 -> 6.0.1 (diff)
benchmarks/mangohud: the port had been updated to version 0.6.5
Now comes with CPU load monitoring enabled by default and better system information report in debug mode. Note that those things currently require mounted linprocfs(5) to work. Reported by: portscout
Diffstat (limited to 'benchmarks/mangohud/files/patch-src_file__utils.cpp')
-rw-r--r--benchmarks/mangohud/files/patch-src_file__utils.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/benchmarks/mangohud/files/patch-src_file__utils.cpp b/benchmarks/mangohud/files/patch-src_file__utils.cpp
new file mode 100644
index 000000000000..4ae32c1fc2b2
--- /dev/null
+++ b/benchmarks/mangohud/files/patch-src_file__utils.cpp
@@ -0,0 +1,28 @@
+--- src/file_utils.cpp.orig 2021-07-08 06:23:59 UTC
++++ src/file_utils.cpp
+@@ -109,7 +109,7 @@ std::string read_symlink(const char * link)
+
+ std::string get_exe_path()
+ {
+- return read_symlink("/proc/self/exe");
++ return read_symlink(PROCDIR "/self/exe");
+ }
+
+ std::string get_wine_exe_name(bool keep_ext)
+@@ -119,14 +119,14 @@ std::string get_wine_exe_name(bool keep_ext)
+ return std::string();
+ }
+
+- std::string line = read_line("/proc/self/comm"); // max 16 characters though
++ std::string line = read_line(PROCDIR "/self/comm"); // max 16 characters though
+ if (ends_with(line, ".exe", true))
+ {
+ auto dot = keep_ext ? std::string::npos : line.find_last_of('.');
+ return line.substr(0, dot);
+ }
+
+- std::ifstream cmdline("/proc/self/cmdline");
++ std::ifstream cmdline(PROCDIR "/self/cmdline");
+ // Iterate over arguments (separated by NUL byte).
+ while (std::getline(cmdline, line, '\0')) {
+ auto n = std::string::npos;