Skip to content

Commit

Permalink
Make this build and work under NetBSD 3.99.20 and newer.
Browse files Browse the repository at this point in the history
Bump package revision because of this fix.
  • Loading branch information
tron committed May 31, 2006
1 parent 4bd4ab3 commit 0e7ff50
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
4 changes: 2 additions & 2 deletions sysutils/aperture/Makefile
@@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.35 2006/03/04 21:30:40 jlam Exp $
# $NetBSD: Makefile,v 1.36 2006/05/31 02:31:56 tron Exp $

DISTNAME= apNetBSD
PKGNAME= aperture-2.0
PKGREVISION= 6
PKGREVISION= 7
CATEGORIES= sysutils x11
EXTRACT_SUFX= .shar
# Not sure why ${MASTER_SITE_LOCAL:=${PKGNAME}} doesn't work, but the
Expand Down
4 changes: 2 additions & 2 deletions sysutils/aperture/distinfo
@@ -1,12 +1,12 @@
$NetBSD: distinfo,v 1.12 2005/12/14 18:27:59 christos Exp $
$NetBSD: distinfo,v 1.13 2006/05/31 02:31:56 tron Exp $

SHA1 (aperture-2.0nb5/apNetBSD.shar) = 66022d35f41df667bbc9ad86a8f2ded292e1098b
RMD160 (aperture-2.0nb5/apNetBSD.shar) = 74739d4d0a5d21d5098c3fab000ad4d622137895
Size (aperture-2.0nb5/apNetBSD.shar) = 66731 bytes
SHA1 (patch-aa) = 544d71b6524b7aaeb5deb985372599f1962af4fe
SHA1 (patch-ab) = fc3f65e9b9bc94880dc18e2091d7daccd3d480ad
SHA1 (patch-ac) = 676b2f426d6f9e725262342e0d7e9ac1c8418362
SHA1 (patch-ad) = 3315365cfbc72efdd6868c2b32958644db9d060f
SHA1 (patch-ad) = bb3ae5f5c5f227d7d95ee68cb06e9f05157e3c5d
SHA1 (patch-ae) = b6ae1d888db3a0cbefd7088a7acf7ca881fdc767
SHA1 (patch-af) = 475c127658ba1050154a7dcabe39482c088e2d02
SHA1 (patch-ag) = cc4d08404f5fcd4fc01b1c711984506408e930bc
41 changes: 29 additions & 12 deletions sysutils/aperture/patches/patch-ad
@@ -1,19 +1,23 @@
$NetBSD: patch-ad,v 1.8 2005/12/14 18:27:59 christos Exp $
$NetBSD: patch-ad,v 1.9 2006/05/31 02:31:56 tron Exp $

--- module/aperture.c.orig 2005-12-14 08:34:23.000000000 -0500
+++ module/aperture.c 2005-12-14 08:41:10.000000000 -0500
@@ -71,6 +71,10 @@
--- module/aperture.c.orig 2006-05-31 03:22:31.000000000 +0100
+++ module/aperture.c 2006-05-31 03:29:49.000000000 +0100
@@ -71,6 +71,14 @@
/* open counter */
static int xf86_open_count = 0;

+#if !defined(__NetBSD_Version__) || __NetBSD_Version__ < 399001400
+#define PROC
+#endif
+
+#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 399002000
+#include <sys/kauth.h>
+#endif
+
/* mem range descriptors */
struct mem_range_softc mem_range_softc;

@@ -78,12 +82,15 @@
@@ -78,16 +86,28 @@
* Open the device
*/
int
Expand All @@ -25,16 +29,29 @@ $NetBSD: patch-ad,v 1.8 2005/12/14 18:27:59 christos Exp $
+xf86open(dev_t dev, int oflags, int devtype,
+#ifdef PROC
+ struct proc *p)
+{
{
+#else
+ struct lwp *l)
{
+{
+ struct proc *p = l->l_proc;
+#endif

+#if !defined(__NetBSD_Version__) || __NetBSD_Version__ < 399002000
if (suser(p->p_ucred, &p->p_acflag) != 0) {
return(EPERM);
@@ -101,11 +108,13 @@
}
+#else
+ int error;
+
+ error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER,
+ &p->p_acflag);
+ if (error != 0)
+ return error;
+#endif
/* authorize only one simultaneous open() */
if (xf86_open_count > 0) {
return(EPERM);
@@ -101,11 +121,13 @@
* Close the device
*/
int
Expand All @@ -53,7 +70,7 @@ $NetBSD: patch-ad,v 1.8 2005/12/14 18:27:59 christos Exp $
{
xf86_open_count--;
return(0);
@@ -117,19 +126,22 @@
@@ -117,19 +139,22 @@
* allow only section in the vga framebuffer and above main memory
* to be mapped
*/
Expand Down Expand Up @@ -85,7 +102,7 @@ $NetBSD: patch-ad,v 1.8 2005/12/14 18:27:59 christos Exp $
#endif /* __NetBSD_Version__ */
{

@@ -144,19 +156,24 @@
@@ -144,19 +169,24 @@
&& (unsigned)offset <= HOLE16M_END)
#endif
)) {
Expand Down Expand Up @@ -116,7 +133,7 @@ $NetBSD: patch-ad,v 1.8 2005/12/14 18:27:59 christos Exp $
{
int nd, error = 0;
struct mem_range_op *mo = (struct mem_range_op *)data;
@@ -212,9 +229,7 @@
@@ -212,9 +242,7 @@
* memory range attributes.
*/
int
Expand All @@ -127,7 +144,7 @@ $NetBSD: patch-ad,v 1.8 2005/12/14 18:27:59 christos Exp $
{
/* can we handle this? */
if (mem_range_softc.mr_op == NULL)
@@ -229,9 +244,7 @@
@@ -229,9 +257,7 @@
}

int
Expand Down

0 comments on commit 0e7ff50

Please sign in to comment.