summaryrefslogtreecommitdiff
path: root/graphics/sane-backends/patches/patch-ac
blob: 56a9d5263e5f0cc47571b2a7574a54f6697a29b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$NetBSD: patch-ac,v 1.6 2015/10/27 11:29:35 wiz Exp $

DragonFly support.
https://alioth.debian.org/tracker/index.php?func=detail&aid=315205&group_id=30186&atid=410366

--- sanei/sanei_ab306.c.orig	2010-04-05 13:18:05.000000000 +0000
+++ sanei/sanei_ab306.c
@@ -78,7 +78,7 @@ inb (u_long port)
 #include "../include/sane/sanei.h"
 #include "../include/sane/sanei_ab306.h"
 
-#if (defined(HAVE_IOPERM) || defined(__FreeBSD__)) && !defined(IO_SUPPORT_MISSING)
+#if (defined(HAVE_IOPERM) || defined(__FreeBSD__) || defined(__DragonFly__)) && !defined(IO_SUPPORT_MISSING)
 
 #include <errno.h>
 #include <fcntl.h>
@@ -99,7 +99,7 @@ inb (u_long port)
 #define PORT_DEV	"/dev/port"
 #define AB306_CIO	0x379		/* control i/o port */
 
-#if defined(__FreeBSD__)	
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 static int dev_io_fd = 0;
 #endif
 
@@ -287,7 +287,7 @@ sanei_ab306_open (const char *dev, int *
 
   status = sanei_ab306_get_io_privilege (i);
 
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__DragonFly__)
   status = sanei_ab306_get_io_privilege (i);
   if (status != SANE_STATUS_GOOD)
     return status;
@@ -366,7 +366,7 @@ sanei_ab306_get_io_privilege (int fd)
 {
   if (port[fd].port_fd < 0)
     {
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__DragonFly__)
       if (dev_io_fd == 0)
 	dev_io_fd = open ("/dev/io", O_RDONLY);
       if (dev_io_fd < 0)
@@ -517,7 +517,7 @@ sanei_ab306_exit (void)
 	/* power off the scanner: */
 	ab306_outb (port + i, port[i].base + 1, 0x00);
       }
-#if defined(__FreeBSD)
+#if defined(__FreeBSD) || defined(__DragonFly__)
   if (dev_io_fd >0)
     close (dev_io_fd);
 #endif /* defined(__FreeBSD__) */