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
|
$NetBSD: patch-ac,v 1.4 2006/08/05 22:41:49 wiz Exp $
--- sanei/sanei_ab306.c.orig 2003-09-09 15:04:45.000000000 +0000
+++ sanei/sanei_ab306.c
@@ -78,7 +78,7 @@ inb (u_long port)
#include "sane/sanei.h"
#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__) */
|