ports/sysutils/smartmontools/files/patch-os__freebsd.cpp
Cy Schubert 2571c076d0 Fix build under -CURRENT following Sr329824.
This commit does not address big endian support, which will be addressed
by a separate revision and commit. This commit (and revision) only
addresses build breakage due to Sr329824.

Approved by:	imp, wma, kan, mst_semihalf.com (Michal Stanek)
Differential Revision:	https://reviews.freebsd.org/D14483
2018-02-26 20:19:51 +00:00

32 lines
824 B
C++

--- os_freebsd.cpp.orig 2017-04-24 09:34:16.000000000 -0700
+++ os_freebsd.cpp 2018-02-22 23:01:44.118712000 -0800
@@ -15,6 +15,7 @@
*
*/
+#include <sys/param.h>
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
@@ -484,7 +485,7 @@
}
nsid = 0xFFFFFFFF; // broadcast id
}
- else if (sscanf(dev, NVME_CTRLR_PREFIX"%d"NVME_NS_PREFIX"%d%c",
+ else if (sscanf(dev, NVME_CTRLR_PREFIX"%d" NVME_NS_PREFIX "%d%c",
&ctrlid, &nsid, &tmp) == 2)
{
if(ctrlid < 0 || nsid < 0) {
@@ -521,7 +522,11 @@
struct nvme_pt_command pt;
memset(&pt, 0, sizeof(pt));
- pt.cmd.opc = in.opcode;
+#if __FreeBSD_version >= 1200058
+ pt.cmd.opc_fuse = NVME_CMD_SET_OPC(in.opcode);
+#else
+ pt.cmd.opc_fuse = in.opcode;
+#endif
pt.cmd.nsid = in.nsid;
pt.buf = in.buffer;
pt.len = in.size;