]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use if ... else when printing memory attributes
authorAndrew Turner <andrew@FreeBSD.org>
Sun, 11 Apr 2021 09:00:00 +0000 (09:00 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Sat, 12 Jun 2021 01:21:12 +0000 (02:21 +0100)
commita0dd2317e8f5daf2e1e3b9cfdd4640a6996487fc
tree27e3954acebdcd464b6276d8a1ed5bbbb4fd8f22
parent2c89a8c9aae25a20882bf33c0f291fab692f307a
Use if ... else when printing memory attributes

In vmstat there is a switch statement that converts these attributes to
a string. As some values can be duplicate we have to hide these from
userspace.

Replace this switch statement with an if ... else macro that lets us
repeat values without a compiler error.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D29703

(cherry picked from commit 15221c552b3cabcbf26613246e855010b176805a)
usr.bin/vmstat/vmstat.c