ps output appears to use K by default, not bytes

This commit is contained in:
Matt Churchyard
2020-01-29 14:50:13 +00:00
parent 7fcf2c1d92
commit c5250b8097
3 changed files with 5 additions and 4 deletions

View File

@@ -25,7 +25,7 @@
# POSSIBILITY OF SUCH DAMAGE.
VERSION=1.5-devel
VERSION_INT=105002
VERSION_INT=105003
VERSION_BSD=$(uname -K)
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

View File

@@ -90,8 +90,8 @@ core::list(){
util::get_part "_vsz" "${_state}" 2
util::get_part "_rss" "${_state}" 3
[ -n "${_vsz}" ] && _vsz=$(info::__bytes_human "${_vsz}" 1)
[ -n "${_rss}" ] && _rss=$(info::__bytes_human "${_rss}" 1)
[ -n "${_vsz}" ] && _vsz=$(info::__bytes_human "${_vsz}" 1 2)
[ -n "${_rss}" ] && _rss=$(info::__bytes_human "${_rss}" 1 2)
fi
fi

View File

@@ -446,10 +446,11 @@ info::__find_bridge(){
info::__bytes_human(){
local _val="$1" _int _ext
local _dec="$2"
local _num=1
local _num="$3"
: ${_dec:=3}
: ${_val:=0}
: ${_num:=1}
_int=${_val%%.*}
while [ ${_int} -ge 1024 -a ${_num} -lt 5 ]; do