diff --git a/library/Process-linux.cpp b/library/Process-linux.cpp index 4a66470f9..1fecbab78 100644 --- a/library/Process-linux.cpp +++ b/library/Process-linux.cpp @@ -127,6 +127,9 @@ void Process::getMemRanges( vector & ranges ) char permissions[5]; // r/-, w/-, x/-, p/s, 0 FILE *mapFile = ::fopen("/proc/self/maps", "r"); + if (!mapFile) + return; + size_t start, end, offset, device1, device2, node; while (fgets(buffer, 1024, mapFile)) @@ -148,6 +151,8 @@ void Process::getMemRanges( vector & ranges ) temp.valid = true; ranges.push_back(temp); } + + fclose(mapFile); } uint32_t Process::getBase() diff --git a/plugins/tweak.cpp b/plugins/tweak.cpp index de7695fb3..bebc346c5 100644 --- a/plugins/tweak.cpp +++ b/plugins/tweak.cpp @@ -89,10 +89,10 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector \n" " Further improves temperature updates by ensuring that 1 degree of\n" " item temperature is crossed in no more than specified number of frames\n" - " when updating from the environment temperature.\n" + " when updating from the environment temperature. Use 0 to disable.\n" )); return CR_OK; }