Index: head/sysutils/rmonitor/Makefile =================================================================== --- head/sysutils/rmonitor/Makefile (revision 397246) +++ head/sysutils/rmonitor/Makefile (revision 397247) @@ -1,29 +1,23 @@ # Created by: Konrad Heuer # $FreeBSD$ PORTNAME= rmonitor PORTVERSION= 1.2 PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ftp://gwdu111.gwdg.de/pub/FreeBSD/misc/ \ ftp://gwdu112.gwdg.de/pub/FreeBSD/misc/ MAINTAINER= kheuer@gwdg.de COMMENT= Remote system monitoring utility LICENSE= BSD4CLAUSE CFLAGS+= -w -.include - -.if ${OSVERSION} >= 900007 -EXTRA_PATCHES+= ${FILESDIR}/extra-patch-utmpx -.endif - do-install: ${INSTALL_PROGRAM} ${WRKSRC}/bin/rmonitor ${STAGEDIR}${PREFIX}/bin/rmonitor ${INSTALL_MAN} ${WRKSRC}/man/rmonitor.1.gz ${STAGEDIR}${MAN1PREFIX}/man/man1/rmonitor.1.gz ${INSTALL_SCRIPT} ${WRKSRC}/etc/rmonitor.sh ${STAGEDIR}${PREFIX}/etc/rc.d/rmonitor.sh -.include +.include Index: head/sysutils/rmonitor/files/extra-patch-utmpx =================================================================== --- head/sysutils/rmonitor/files/extra-patch-utmpx (revision 397246) +++ head/sysutils/rmonitor/files/extra-patch-utmpx (nonexistent) @@ -1,51 +0,0 @@ ---- src/rmonitor.c -+++ src/rmonitor.c -@@ -88,7 +88,7 @@ - #include - #include - #include --#include -+#include - - - #define DEFTOL 2.5 /* default tolerance */ -@@ -300,7 +300,7 @@ - int memfre = 0; - int memtot = 0; - int memuse = 0; -- int nu = -1; -+ int nu = 0; - int np = -1; - int openf = -1; - int pgcnt = 0; -@@ -309,9 +309,8 @@ - int pgsize = 0; - int slvl = 0; - int vn[3]; -- int utfd; - time_t ct; -- struct utmp utmprec; -+ struct utmpx *utmprec; - - union { - char buf[STRLEN]; -@@ -402,14 +401,12 @@ - - if (getloadavg(lavg, samples) != samples) errmsg("getloadavg"); - -- if ((utfd = open(_PATH_UTMP, O_RDONLY)) >= 0) { -- nu = 0; -- while (read(utfd, &utmprec, sizeof utmprec) > 0) -- if (*(utmprec.ut_name)) nu++; -- if (close(utfd) < 0) errmsg("close"); -+ setutxent(); -+ while ((utmprec = getutxent()) != NULL) { -+ if (utmprec->ut_type == USER_PROCESS) -+ nu++; - } -- else -- errmsg("open"); -+ endutxent(); - - #if __FreeBSD_version >= 420000 - snprintf(stat, STRLEN, Property changes on: head/sysutils/rmonitor/files/extra-patch-utmpx ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/rmonitor/files/patch-utmpx =================================================================== --- head/sysutils/rmonitor/files/patch-utmpx (nonexistent) +++ head/sysutils/rmonitor/files/patch-utmpx (revision 397247) @@ -0,0 +1,51 @@ +--- src/rmonitor.c ++++ src/rmonitor.c +@@ -88,7 +88,7 @@ + #include + #include + #include +-#include ++#include + + + #define DEFTOL 2.5 /* default tolerance */ +@@ -300,7 +300,7 @@ + int memfre = 0; + int memtot = 0; + int memuse = 0; +- int nu = -1; ++ int nu = 0; + int np = -1; + int openf = -1; + int pgcnt = 0; +@@ -309,9 +309,8 @@ + int pgsize = 0; + int slvl = 0; + int vn[3]; +- int utfd; + time_t ct; +- struct utmp utmprec; ++ struct utmpx *utmprec; + + union { + char buf[STRLEN]; +@@ -402,14 +401,12 @@ + + if (getloadavg(lavg, samples) != samples) errmsg("getloadavg"); + +- if ((utfd = open(_PATH_UTMP, O_RDONLY)) >= 0) { +- nu = 0; +- while (read(utfd, &utmprec, sizeof utmprec) > 0) +- if (*(utmprec.ut_name)) nu++; +- if (close(utfd) < 0) errmsg("close"); ++ setutxent(); ++ while ((utmprec = getutxent()) != NULL) { ++ if (utmprec->ut_type == USER_PROCESS) ++ nu++; + } +- else +- errmsg("open"); ++ endutxent(); + + #if __FreeBSD_version >= 420000 + snprintf(stat, STRLEN, Property changes on: head/sysutils/rmonitor/files/patch-utmpx ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property