Have SYS_FIRMWARE_DIR point to the sysfs directory where our files
live, and use it in the definition of their paths. This makes it
easier to temporarily point somewhere else for debugging.
---
 dmidecode.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- dmidecode.orig/dmidecode.c  2015-10-15 08:00:13.555500942 +0200
+++ dmidecode/dmidecode.c       2015-10-15 08:01:34.916209140 +0200
@@ -74,8 +74,9 @@ static const char *bad_index = "<BAD IND
 #define FLAG_NO_FILE_OFFSET     (1 << 0)
 #define FLAG_STOP_AT_EOT        (1 << 1)
 
-#define SYS_ENTRY_FILE "/sys/firmware/dmi/tables/smbios_entry_point"
-#define SYS_TABLE_FILE "/sys/firmware/dmi/tables/DMI"
+#define SYS_FIRMWARE_DIR "/sys/firmware/dmi/tables"
+#define SYS_ENTRY_FILE SYS_FIRMWARE_DIR "/smbios_entry_point"
+#define SYS_TABLE_FILE SYS_FIRMWARE_DIR "/DMI"
 
 /*
  * Type-independant Stuff


-- 
Jean Delvare
SUSE L3 Support

_______________________________________________
https://lists.nongnu.org/mailman/listinfo/dmidecode-devel

Reply via email to