- Unbreak. Fix an ill patch.

- Bump PORTREVISION for users who install a bad version
  before it was marked broken.
This commit is contained in:
Sergey Matveychuk 2005-10-06 10:57:46 +00:00
parent ea7c0978ec
commit 79c506a76d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=144378
2 changed files with 16 additions and 31 deletions

View file

@ -8,7 +8,7 @@
PORTNAME= and
PORTVERSION= 1.0.9
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@ -23,10 +23,4 @@ NOPRECIOUSMAKEVARS= yes
MAN5= and.conf.5 and.priorities.5
MAN8= and.8
.include <bsd.port.pre.mk>
.if ${OSVERSION} > 500014
BROKEN= "Not functional due kernel changes >= 5.x"
.endif
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -1,37 +1,28 @@
--- and-OpenBSD.c.orig Mon Jan 28 01:02:51 2002
+++ and-OpenBSD.c Sat Dec 21 02:04:58 2002
@@ -91,17 +91,38 @@
--- and-OpenBSD.c.orig Sun Jan 27 18:52:18 2002
+++ and-OpenBSD.c Thu Oct 6 14:51:53 2005
@@ -91,6 +91,21 @@
abort();
}
if (openbsd_next >= openbsd_nproc) return NULL;
+
+#if defined(__FreeBSD__) && __FreeBSD_version >= 500014
+ /* Skip kernel threads */
+ while((openbsd_pt[openbsd_next].ki_flag & P_KTHREAD)
+ && openbsd_next < openbsd_nproc)
+ openbsd_next++;
+ if (openbsd_next >= openbsd_nproc) return NULL;
+ strncpy(openbsd_proc.command,openbsd_pt[openbsd_next].ki_comm,1023);
+#else
strncpy(openbsd_proc.command,openbsd_pt[openbsd_next].kp_proc.p_comm,1023);
+#endif
openbsd_proc.command[1023] = 0;
+#if defined(__FreeBSD__) && __FreeBSD_version >= 500014
+ openbsd_proc.command[1023] = 0;
+ openbsd_proc.pid = openbsd_pt[openbsd_next].ki_pid;
+ openbsd_proc.nice = openbsd_pt[openbsd_next].ki_nice-20;
+ openbsd_proc.uid = openbsd_pt[openbsd_next].ki_ruid;
+ openbsd_proc.gid = openbsd_pt[openbsd_next].ki_rgid;
+ openbsd_proc.utime = (openbsd_pt[openbsd_next].ki_runtime+500000)/1000000;
+#else
strncpy(openbsd_proc.command,openbsd_pt[openbsd_next].kp_proc.p_comm,1023);
openbsd_proc.command[1023] = 0;
openbsd_proc.pid = openbsd_pt[openbsd_next].kp_proc.p_pid;
openbsd_proc.nice = openbsd_pt[openbsd_next].kp_proc.p_nice-20;
openbsd_proc.uid = openbsd_pt[openbsd_next].kp_eproc.e_pcred.p_ruid;
openbsd_proc.gid = openbsd_pt[openbsd_next].kp_eproc.e_pcred.p_rgid;
+#endif
/* Adapted from top(1) port, as found in the misc@openbsd.org archive */
+#if defined(__FreeBSD__) && __FreeBSD_version >= 500014
+ /* XXX: Accessing ki_paddr causes sig10 ...
+ openbsd_proc.utime = (openbsd_pt[openbsd_next].ki_paddr->p_uticks +
+ openbsd_pt[openbsd_next].ki_paddr->p_sticks +
+ openbsd_pt[openbsd_next].ki_paddr->p_iticks)
+ / openbsd_hz;
+ */
+ openbsd_proc.utime = 0;
+#else
openbsd_proc.utime = (openbsd_pt[openbsd_next].kp_proc.p_uticks +
@@ -102,6 +117,7 @@
openbsd_pt[openbsd_next].kp_proc.p_sticks +
openbsd_pt[openbsd_next].kp_proc.p_iticks)
/ openbsd_hz;