/*
* os_netbsd.cpp
*
- * Home page of code is: http://smartmontools.sourceforge.net
+ * Home page of code is: http://www.smartmontools.org
*
* Copyright (C) 2003-8 Sergey Svishchev <smartmontools-support@lists.sourceforge.net>
*
* any later version.
*
* You should have received a copy of the GNU General Public License
- * (for example COPYING); if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * (for example COPYING); if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <errno.h>
#include <unistd.h>
-const char * os_netbsd_cpp_cvsid = "$Id: os_netbsd.cpp 3265 2011-02-21 16:21:14Z chrfranke $"
+const char * os_netbsd_cpp_cvsid = "$Id: os_netbsd.cpp 4205 2016-01-22 15:22:53Z samm2 $"
OS_NETBSD_H_CVSID;
/* global variable holding byte count of allocated memory */
extern long long bytes;
enum warnings {
- BAD_SMART, NO_3WARE, NO_ARECA, MAX_MSG
+ BAD_SMART, MAX_MSG
};
/* Utility function for printing warnings */
n++;
}
- mp = (char **)realloc(mp, n * (sizeof(char *)));
+ void * tmp = (char **)realloc(mp, n * (sizeof(char *)));
+ if (NULL == tmp) {
+ pout("Out of memory constructing scan device list\n");
+ free(mp);
+ return -1;
+ }
+ else
+ mp = tmp;
bytes += (n) * (sizeof(char *));
*names = mp;
return n;
return close(fd);
}
-int
-marvell_command_interface(int fd, smart_command_set command, int select, char *data)
-{ return -1; }
-
-int
-highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
-{ return -1; }
-
int
ata_command_interface(int fd, smart_command_set command, int select, char *data)
{
return 0;
}
- if ((retval = ioctl(fd, ATAIOCCOMMAND, &req))) {
+ retval = ioctl(fd, ATAIOCCOMMAND, &req);
+ if (retval < 0) {
perror("Failed command");
return -1;
}
return 0;
}
-int
-escalade_command_interface(int fd, int disknum, int escalade_type, smart_command_set command, int select, char *data)
-{
- printwarning(NO_3WARE, NULL);
- return -1;
-}
-
-int
-areca_command_interface(int fd, int disknum, smart_command_set command, int select, char *data)
-{
- printwarning(NO_ARECA, NULL);
- return -1;
-}
-
int
do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
{