From: Bernd Zeimetz Date: Tue, 21 Sep 2021 08:44:27 +0000 (+0200) Subject: Fic smart_test.c for big endian. (#3799) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d228c3129c270754b61bf3caae0af36bc7a9c73a;p=thirdparty%2Fcollectd.git Fic smart_test.c for big endian. (#3799) get_vendor_id from smart.c assumes that VENDOR_ID is le16, so we need to convert it into le16 in the fake-ioctl function in smart_test.c. Fixes #3791 Signed-off-by: Bernd Zeimetz --- diff --git a/src/smart_test.c b/src/smart_test.c index f1a01e639..e37585e20 100644 --- a/src/smart_test.c +++ b/src/smart_test.c @@ -46,7 +46,7 @@ int ioctl(int __fd, unsigned long int __request, ...) { if (admin_cmd->opcode == NVME_ADMIN_IDENTIFY) { // ioctl asked about vid __le16 *vid = (__le16 *)addr; - *vid = VENDOR_ID; + *vid = htole16(VENDOR_ID); return 0; } else if (admin_cmd->opcode == NVME_ADMIN_GET_LOG_PAGE) { // ioctl asked about smart attributes