Package: hamlib
Severity: important
Tags: patch

Hi,

the current version of hamlib fails to build on GNU/kFreeBSD.

Please find attached patch to fix that.        
It would be nice if you could propagate it into upstream.  

Thanks in advance,

        Petr


--- hamlib-1.2.4.orig/src/parallel.c
+++ hamlib-1.2.4/src/parallel.c
@@ -55,11 +55,15 @@
 #include "hamlib/rig.h"
 #include "parallel.h"
 
-
-
 #ifdef HAVE_LINUX_PPDEV_H
 #include <linux/ppdev.h>
 #include <linux/parport.h>
+#endif
+
+#ifdef HAVE_DEV_PPBUS_PPI_H
+#include <dev/ppbus/ppi.h>
+#include <dev/ppbus/ppbconf.h>
+#endif
 
 /* 
  * These control port bits are active low.
@@ -75,14 +79,6 @@
  */
 #define SP_ACTIVE_LOW_BITS     0x80
 
-#endif
-
-
-#ifdef HAVE_DEV_PPBUS_PPI_H
-#include <dev/ppbus/ppi.h>
-#include <dev/ppbus/ppbconf.h>
-#endif
-
 
 /*
  * TODO: to be called before exiting: atexit(parport_cleanup)
@@ -266,11 +262,11 @@
        *status = sta ^ SP_ACTIVE_LOW_BITS;
        return ret == 0 ? RIG_OK : -RIG_EIO;
 #elif defined(HAVE_DEV_PPBUS_PPI_H)
-       int status;
+       int ret;
        unsigned char sta;
-       status = ioctl(port->fd, PPIGSTATUS, &sta);
-       *control = sta ^ SP_ACTIVE_LOW_BITS;
-       return status == 0 ? RIG_OK : -RIG_EIO;
+       ret = ioctl(port->fd, PPIGSTATUS, &sta);
+       *status = sta ^ SP_ACTIVE_LOW_BITS;
+       return ret == 0 ? RIG_OK : -RIG_EIO;
 #elif defined(WIN32)
        unsigned char ret;
        unsigned int dummy;

Reply via email to