mon_tools: fix user counting condition

The ut_user (aka ut_name) member of struct utmp is a statically
allocated string, thus always non-NULL.

GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/137
Signed-off-by: Dan Horák <dan@danny.cz>
Acked-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Dan Horák
2022-06-06 08:43:52 +00:00
committed by Jan Höppner
parent 53c523ab19
commit ff62f4d425

View File

@@ -248,7 +248,7 @@ static void count_users(void)
proc_sum.users = 0;
setutent();
while ((temp = getutent())) {
if ((temp->ut_type == USER_PROCESS) && (temp->ut_name))
if (temp->ut_type == USER_PROCESS)
proc_sum.users++;
}
endutent();