mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user