From: Steinar H. Gunderson Date: Mon, 26 Dec 2016 14:12:09 +0000 (+0100) Subject: If running with unlimited amounts of lockable memory (e.g. as root), give a less... X-Git-Tag: 1.5.0~85 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4bfa989f060c88bd1644ed03f66faa6192b1244f;p=nageru If running with unlimited amounts of lockable memory (e.g. as root), give a less confusing status message. --- diff --git a/mixer.cpp b/mixer.cpp index db7a060..875fc6f 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -680,10 +680,15 @@ void Mixer::thread_func() assert(false); } - printf(", using %ld / %ld MB lockable memory (%.1f%%)", - long(used.ru_maxrss / 1024), - long(limit.rlim_cur / 1048576), - float(100.0 * (used.ru_maxrss * 1024.0) / limit.rlim_cur)); + if (limit.rlim_cur == 0) { + printf(", using %ld MB memory (locked)", + long(used.ru_maxrss / 1024)); + } else { + printf(", using %ld / %ld MB lockable memory (%.1f%%)", + long(used.ru_maxrss / 1024), + long(limit.rlim_cur / 1048576), + float(100.0 * (used.ru_maxrss * 1024.0) / limit.rlim_cur)); + } } else { printf(", using %ld MB memory (not locked)", long(used.ru_maxrss / 1024));