File: fix-smart-test

package info (click to toggle)
collectd 5.12.0-27
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,160 kB
  • sloc: ansic: 120,848; perl: 20,684; php: 3,007; makefile: 2,441; java: 1,713; javascript: 920; python: 892; sh: 799; cpp: 638; yacc: 231; sql: 198; lex: 146; ruby: 49; xml: 44
file content (22 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Index: collectd/src/smart_test.c
===================================================================
--- collectd.orig/src/smart_test.c
+++ collectd/src/smart_test.c
@@ -30,6 +30,8 @@
 #include "smart.c"
 #include "testing.h"
 
+
+
 #define INTEL_VID 0x8086
 
 int VENDOR_ID = INTEL_VID;
@@ -46,7 +48,7 @@ int ioctl(int __fd, unsigned long int __
   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