From d228c3129c270754b61bf3caae0af36bc7a9c73a Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Tue, 21 Sep 2021 10:44:27 +0200 Subject: [PATCH] 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 --- src/smart_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.2