]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Fic smart_test.c for big endian. (#3799)
authorBernd Zeimetz <bernd@bzed.de>
Tue, 21 Sep 2021 08:44:27 +0000 (10:44 +0200)
committerGitHub <noreply@github.com>
Tue, 21 Sep 2021 08:44:27 +0000 (10:44 +0200)
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 <bernd@bzed.de>
src/smart_test.c

index f1a01e639a4480755072d164baed53dc8b30da9e..e37585e20fe905d6873be6d8f1d8b98ccfd59c3d 100644 (file)
@@ -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