Clean return value if sysconf fails

This commit is contained in:
Tom Lally 2022-09-02 21:01:31 +01:00
parent 49d1b1feb4
commit e3ea4c5046

View file

@ -8,6 +8,10 @@
uint64 QueryRamUsage()
{
long page_size = sysconf(_SC_PAGESIZE);
if (page_size == -1)
{
return 0;
}
std::ifstream file("/proc/self/statm");
if (file)