]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - cciss.cpp
Stop passing arguments to dh_installinit
[mirror_smartmontools-debian.git] / cciss.cpp
index fca75ac206a07a9fbbf00048c8e7bb1a17f8a5a5..f5871dd75786f959bfdf9457cce6644fb0e18c0a 100644 (file)
--- a/cciss.cpp
+++ b/cciss.cpp
@@ -1,10 +1,11 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
+#include <errno.h>
 
 #include "config.h"
 
-#if defined(linux)
+#if defined(linux) || defined(__linux__)
 #  include <sys/ioctl.h>
 #  ifdef HAVE_LINUX_COMPILER_H
 #    include <linux/compiler.h>
 #    define _HAVE_CCISS
 #  endif
 #  include <asm/byteorder.h>
-#  define be32toh __be32_to_cpu
-#elif defined(__FreeBSD__) && defined(HAVE_DEV_CISS_CISSIO_H)
+#  ifndef be32toh
+#    define be32toh __be32_to_cpu
+#  endif
+#elif defined(__FreeBSD__)
 #  include <sys/endian.h>
-#  include <dev/ciss/cissio.h>
+#  include CISS_LOCATION
 #  define _HAVE_CCISS
-#elif defined(__FreeBSD_kernel__) && defined(HAVE_DEV_CISS_CISSIO_H)
+#elif defined(__FreeBSD_kernel__)
 #  include <endian.h>
-#  include <dev/ciss/cissio.h>
+#  ifdef __GLIBC__
+#  include <bsd/sys/cdefs.h>
+#  include <stdint.h>
+#  endif
+#  include CISS_LOCATION
 #  define _HAVE_CCISS
 #endif
 
 #ifdef _HAVE_CCISS
+#include "cciss.h"
 #include "int64.h"
 #include "scsicmds.h"
 #include "utility.h"
 
-const char *cciss_c_cvsid="$Id: cciss.cpp,v 1.9 2008/07/30 20:42:53 chrfranke Exp $"
-CONFIG_H_CVSID INT64_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
+const char * cciss_cpp_cvsid = "$Id: cciss.cpp 4156 2015-10-18 12:20:40Z samm2 $"
+  CCISS_H_CVSID;
 
 typedef struct _ReportLUNdata_struct
 {
@@ -65,10 +73,9 @@ int cciss_io_interface(int device, int target, struct scsi_cmnd_io * iop, int re
      unsigned char pBuf[512] = {0};
      unsigned char phylun[8] = {0};
      int iBufLen = 512;
-     int status = -1;
      int len = 0; // used later in the code.
  
-     status = cciss_getlun(device, target, phylun, report);
+     int status = cciss_getlun(device, target, phylun, report);
      if (report > 0)
          printf("  cciss_getlun(%d, %d) = 0x%x; scsi3addr: %02x %02x %02x %02x %02x %02x %02x %02x\n", 
             device, target, status, 
@@ -173,7 +180,7 @@ static int cciss_sendpassthru(unsigned int cmdtype, unsigned char *CDB,
 
     if ((err = ioctl(fd, CCISS_PASSTHRU, &iocommand))) 
     {
-        fprintf(stderr, "CCISS ioctl error %d (fd %d CDBLen %d buf_size %d)\n",
+        fprintf(stderr, "CCISS ioctl error %d (fd %d CDBLen %u buf_size %u)\n",
            fd, err, CDBlen, size);
     }
     return err;