comparison dep/animone/src/fd/proc.cc @ 309:bf89fbf7ff38

misc: remove copyrighted app icon if someone comes up with a good icon, please be my guest
author Paper <paper@paper.us.eu.org>
date Tue, 11 Jun 2024 04:24:59 -0400
parents b1f625b0227c
children a4257370de16
comparison
equal deleted inserted replaced
308:da2c5a8ff306 309:bf89fbf7ff38
4 4
5 #include <filesystem> 5 #include <filesystem>
6 #include <fstream> 6 #include <fstream>
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 #include <algorithm>
9 10
10 #include <fcntl.h> 11 #include <fcntl.h>
11 #include <sys/stat.h> 12 #include <sys/stat.h>
12 #include <unistd.h> 13 #include <unistd.h>
13 14
78 const std::filesystem::path path = std::filesystem::path(PROC_LOCATION) / std::to_string(pid) / "comm"; 79 const std::filesystem::path path = std::filesystem::path(PROC_LOCATION) / std::to_string(pid) / "comm";
79 80
80 if (!util::ReadFile(path, result)) 81 if (!util::ReadFile(path, result))
81 return false; 82 return false;
82 83
83 result.erase(std::remove(result.begin(), result.end(), '\n'), result.end()); 84 result.erase(std::remove(result.begin(), result.end(), '\n'), result.cend());
84 return true; 85 return true;
85 } 86 }
86 87
87 bool EnumerateOpenProcesses(process_proc_t process_proc) { 88 bool EnumerateOpenProcesses(process_proc_t process_proc) {
88 bool success = false; 89 bool success = false;