Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Sep 2015 14:46:56 +0000 (UTC)
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r397247 - in head/sysutils/rmonitor: . files
Message-ID:  <201509181446.t8IEku6V094364@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: amdmi3
Date: Fri Sep 18 14:46:56 2015
New Revision: 397247
URL: https://svnweb.freebsd.org/changeset/ports/397247

Log:
  - Drop 8.x support
  
  Approved by:	portmgr blanket

Added:
  head/sysutils/rmonitor/files/patch-utmpx
     - copied unchanged from r397114, head/sysutils/rmonitor/files/extra-patch-utmpx
Deleted:
  head/sysutils/rmonitor/files/extra-patch-utmpx
Modified:
  head/sysutils/rmonitor/Makefile

Modified: head/sysutils/rmonitor/Makefile
==============================================================================
--- head/sysutils/rmonitor/Makefile	Fri Sep 18 14:46:55 2015	(r397246)
+++ head/sysutils/rmonitor/Makefile	Fri Sep 18 14:46:56 2015	(r397247)
@@ -15,15 +15,9 @@ LICENSE=	BSD4CLAUSE
 
 CFLAGS+=	-w
 
-.include <bsd.port.pre.mk>
-
-.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 <bsd.port.post.mk>
+.include <bsd.port.mk>

Copied: head/sysutils/rmonitor/files/patch-utmpx (from r397114, head/sysutils/rmonitor/files/extra-patch-utmpx)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/rmonitor/files/patch-utmpx	Fri Sep 18 14:46:56 2015	(r397247, copy of r397114, head/sysutils/rmonitor/files/extra-patch-utmpx)
@@ -0,0 +1,51 @@
+--- src/rmonitor.c
++++ src/rmonitor.c
+@@ -88,7 +88,7 @@
+ #include <sys/vmmeter.h>
+ #include <time.h>
+ #include <unistd.h>
+-#include <utmp.h>
++#include <utmpx.h>
+ 
+ 
+ #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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509181446.t8IEku6V094364>