summaryrefslogtreecommitdiff
path: root/sanei/sanei_ab306.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-15 11:29:05 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-15 11:29:05 +0200
commit324a8a71bb7d9e4f8bc49b6bc47efaf9fb58282e (patch)
treebd2d48a139bfbe869f4f49359b63097931a45e7b /sanei/sanei_ab306.c
parent2ca8a81bd0d99fe4d75c229d0e988d8ef710285f (diff)
parent1edb02101a9306fc711cd422ed507d18165b1691 (diff)
Merge branch 'release/experimental/1.0.27-1_experimental1'experimental/1.0.27-1_experimental1
Diffstat (limited to 'sanei/sanei_ab306.c')
-rw-r--r--sanei/sanei_ab306.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sanei/sanei_ab306.c b/sanei/sanei_ab306.c
index c663d38..898acf6 100644
--- a/sanei/sanei_ab306.c
+++ b/sanei/sanei_ab306.c
@@ -81,7 +81,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>
@@ -102,7 +102,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
@@ -290,7 +290,7 @@ sanei_ab306_open (const char *dev, int *fdp)
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;
@@ -369,7 +369,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)
@@ -461,7 +461,6 @@ sanei_ab306_rdata (int fd, int planes, SANE_Byte * buf, int lines, int bpl)
{
Port *p = port + fd;
int lcnt, pcnt, bcnt, xmax;
- SANE_Byte *lsave_bp;
int nstat;
DBG(2, "sanei_ab306_rdata: start\n");
@@ -471,7 +470,6 @@ sanei_ab306_rdata (int fd, int planes, SANE_Byte * buf, int lines, int bpl)
/* the lines-loop: */
for (lcnt = 0; lcnt < lines; ++lcnt)
{
- lsave_bp = buf;
/* the planes-loop: */
for (pcnt = 0; pcnt < planes; ++pcnt)
{
@@ -520,7 +518,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__) */