From 45ae66d1ad43708da953835b5dd30c1127d59019 Mon Sep 17 00:00:00 2001 From: tokkee Date: Sun, 4 Dec 2005 18:23:19 +0000 Subject: [PATCH] Now using utmpx instead of utmp in users.c to be POSIX 1003.1-2001 compliant. --- src/users.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/users.c b/src/users.c index f2808dd9..36cea0fb 100644 --- a/src/users.c +++ b/src/users.c @@ -30,7 +30,7 @@ #include "plugin.h" #include "common.h" -#include +#include static char *rrd_file = "users.rrd"; @@ -51,17 +51,16 @@ void users_init(void) void users_read(void) { unsigned int users = 0; - unsigned int root = 0; - struct utmp *entry = NULL; + struct utmpx *entry = NULL; /* according to the *utent(3) man page none of the functions sets errno in * case of an error, so we cannot do any error-checking here */ - setutent(); + setutxent(); - while (NULL != (entry = getutent())) + while (NULL != (entry = getutxent())) if (USER_PROCESS == entry->ut_type) ++users; - endutent(); + endutxent(); users_submit(users); return; -- 2.11.0