diff --git a/sm5/os_openbsd.cpp b/sm5/os_openbsd.cpp index a1847cb56d673b2499f09687b6b9e592ab83f84a..52bc234edf7a902d15276983b8e8007c8468f6e9 100644 --- a/sm5/os_openbsd.cpp +++ b/sm5/os_openbsd.cpp @@ -25,7 +25,7 @@ #include "utility.h" #include "os_openbsd.h" -const char *os_XXXX_c_cvsid = "$Id: os_openbsd.cpp,v 1.11 2006/08/25 06:06:25 sxzzsf Exp $" \ +const char *os_XXXX_c_cvsid = "$Id: os_openbsd.cpp,v 1.12 2006/09/19 07:22:09 snyderx Exp $" \ ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_OPENBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID; /* global variable holding byte count of allocated memory */ @@ -105,7 +105,7 @@ get_dev_names(char ***names, const char *prefix) pout("Failed to get value of sysctl `hw.disknames'\n"); return -1; } - if (!(disknames = malloc(sysctl_len))) { + if (!(disknames = (char*)malloc(sysctl_len))) { pout("Out of memory constructing scan device list\n"); return -1; } @@ -121,7 +121,7 @@ get_dev_names(char ***names, const char *prefix) if (strncmp(p, prefix, strlen(prefix))) { continue; } - mp[n] = malloc(strlen(net_dev_prefix) + strlen(p) + 2); + mp[n] = (char*)malloc(strlen(net_dev_prefix) + strlen(p) + 2); if (!mp[n]) { pout("Out of memory constructing scan device list\n"); return -1; @@ -131,7 +131,7 @@ get_dev_names(char ***names, const char *prefix) n++; } - mp = realloc(mp, n * (sizeof(char *))); + mp = (char**)realloc(mp, n * (sizeof(char *))); bytes += (n) * (sizeof(char *)); *names = mp; return n; @@ -390,7 +390,7 @@ do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report) memset(&sc, 0, sizeof(sc)); memcpy(sc.cmd, iop->cmnd, iop->cmnd_len); sc.cmdlen = iop->cmnd_len; - sc.databuf = iop->dxferp; + sc.databuf = (char*)iop->dxferp; sc.datalen = iop->dxfer_len; sc.senselen = iop->max_sense_len; sc.timeout = iop->timeout == 0 ? 60000 : iop->timeout; /* XXX */ diff --git a/sm5/os_openbsd.h b/sm5/os_openbsd.h index 356343a9fa166778abb9c6ab719951e919c2441a..eb7f63943eac4dfb1c540b5a629718a3b0085bb0 100644 --- a/sm5/os_openbsd.h +++ b/sm5/os_openbsd.h @@ -26,7 +26,7 @@ #ifndef OS_OPENBSD_H_ #define OS_OPENBSD_H_ -#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h,v 1.4 2006/04/12 14:54:28 ballen4705 Exp $\n" +#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h,v 1.5 2006/09/19 07:22:09 snyderx Exp $\n" /* from NetBSD: atareg.h,v 1.17, by Manuel Bouyer */ /* Actually fits _perfectly_ into OBSDs wdcreg.h, but... */ @@ -51,5 +51,6 @@ #include <err.h> #include <fcntl.h> #include <util.h> +#include <unistd.h> #endif /* OS_OPENBSD_H_ */