From b80064cbb9898918e6563795d0233e58fde5e7a6 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Thu, 8 Jul 2010 07:37:32 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'RELEASE_8_1_0'. --- x11-wm/e17-module-uptime/files/extra::e_mod_main.c | 58 ---------------------- 1 file changed, 58 deletions(-) delete mode 100644 x11-wm/e17-module-uptime/files/extra::e_mod_main.c (limited to 'x11-wm/e17-module-uptime/files/extra::e_mod_main.c') diff --git a/x11-wm/e17-module-uptime/files/extra::e_mod_main.c b/x11-wm/e17-module-uptime/files/extra::e_mod_main.c deleted file mode 100644 index 5c67b053ff41..000000000000 --- a/x11-wm/e17-module-uptime/files/extra::e_mod_main.c +++ /dev/null @@ -1,58 +0,0 @@ ---- e_mod_main.c -+++ e_mod_main.c -@@ -4,7 +4,7 @@ - #include - #include - #include --#include -+#include - - #if TIME_WITH_SYS_TIME - # include -@@ -445,11 +445,7 @@ - struct timeval boottime; - time_t now; - -- FILE *utmp; -- struct timespec tp; -- struct utmp ut; -- char ttybuf[MAXPATHLEN]; -- struct stat st; -+ struct utmpx *utmpstruct; - #endif - - if (!inst) -@@ -498,26 +494,15 @@ - if (ret < 0) - warn ("getloadavg()"); - # endif -- -- /* retrive number of active users */ -- utmp = fopen (_PATH_UTMP, "r"); -- if (utmp == NULL) -- inst->nusers = -1; -- else -+ inst->nusers = 0; -+ setutxent (); -+ while ((utmpstruct = getutxent ())) - { -- for (inst->nusers = 0; fread (&ut, sizeof (ut), 1, utmp);) -- { -- if (ut.ut_name[0] == '\0') -- continue; -- (void) snprintf (ttybuf, sizeof (ttybuf), "%s%.*s", _PATH_DEV, -- UT_LINESIZE, ut.ut_line); -- if (stat (ttybuf, &st) != 0) -- continue; /* broken record */ -- -- inst->nusers++; -- } -- fclose (utmp); -+ if ((utmpstruct->ut_type == USER_PROCESS) && -+ (utmpstruct->ut_user[0] != '\0')) -+ inst->nusers++; - } -+ endutxent (); - #else /* unsupported */ - inst->uptime = -1; - inst->nusers = -1; -- cgit v1.2.3