From 2520e4983eb084cf0b48dded77d358d9f085b9d2 Mon Sep 17 00:00:00 2001 From: samm-git Date: Fri, 9 Nov 2018 07:18:23 +0000 Subject: [PATCH 225/291] os_darwin.cpp, os_freebsd.cpp: fix return value in error paths git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@4831 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- smartmontools/ChangeLog | 5 +++++ smartmontools/os_darwin.cpp | 4 ++-- smartmontools/os_freebsd.cpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/smartmontools/os_darwin.cpp b/smartmontools/os_darwin.cpp index 1620981b..25888047 100644 --- a/smartmontools/os_darwin.cpp +++ b/smartmontools/os_darwin.cpp @@ -403,7 +403,7 @@ bool darwin_ata_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & ou int rc = 0; if (! ifp) - return -1; + return false; smartIf = *ifp; clear_err(); errno = 0; do { @@ -558,7 +558,7 @@ bool darwin_nvme_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out unsigned int page = in.cdw10 & 0xff; if (! ifp) - return -1; + return false; smartIfNVMe = *ifp; // currently only GetIdentifyData and SMARTReadData are supported switch (in.opcode) { diff --git a/smartmontools/os_freebsd.cpp b/smartmontools/os_freebsd.cpp index 49f82c58..ffe3b151 100644 --- a/smartmontools/os_freebsd.cpp +++ b/smartmontools/os_freebsd.cpp @@ -613,7 +613,7 @@ bool freebsd_escalade_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_ou if (m_disknum < 0) { printwarning(NO_DISK_3WARE,NULL); - return -1; + return false; } memset(ioctl_buffer, 0, TW_IOCTL_BUFFER_SIZE); -- 2.19.1