summaryrefslogtreecommitdiffstats
path: root/src/dmidecode.c
diff options
context:
space:
mode:
authorNima Talebi <nima@autonomy.net.au>2009-05-23 14:37:01 +1000
committerNima Talebi <nima@autonomy.net.au>2009-05-23 14:37:01 +1000
commita18a72fab2a622077d5257003b09be30ab283339 (patch)
tree6325f80f94bea1cba7f1018a58d8a3f4826606e3 /src/dmidecode.c
parent90c5bac90b3366b897d7c34a4bba2a31e608b62c (diff)
downloadpython-dmidecode-a18a72fab2a622077d5257003b09be30ab283339.tar.gz
python-dmidecode-a18a72fab2a622077d5257003b09be30ab283339.tar.xz
python-dmidecode-a18a72fab2a622077d5257003b09be30ab283339.zip
More cleanup
Don't write to stdout unless in debug mode (with respect to writing to memory devices. Added the xml datafile to setup (distutils). Updated test case (incorporating color and cleaning up tests).
Diffstat (limited to 'src/dmidecode.c')
-rw-r--r--src/dmidecode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dmidecode.c b/src/dmidecode.c
index 9a0baa8..de6fb2a 100644
--- a/src/dmidecode.c
+++ b/src/dmidecode.c
@@ -4931,7 +4931,9 @@ int dumpling(u8 * buf, const char *dumpfile, u8 mode)
if((buff = mem_chunk(base, len, DEFAULT_MEM_DEV)) != NULL) {
//. Part 1.
+#ifdef NDEBUG
printf("# Writing %d bytes to %s.\n", len, dumpfile);
+#endif
write_dump(32, len, buff, dumpfile, 0);
free(buff);
@@ -4941,14 +4943,18 @@ int dumpling(u8 * buf, const char *dumpfile, u8 mode)
memcpy(crafted, buf, 32);
overwrite_dmi_address(crafted + 0x10);
+#ifdef NDEBUG
printf("# Writing %d bytes to %s.\n", crafted[0x05], dumpfile);
+#endif
write_dump(0, crafted[0x05], crafted, dumpfile, 1);
} else {
u8 crafted[16];
memcpy(crafted, buf, 16);
overwrite_dmi_address(crafted);
+#ifdef NDEBUG
printf("# Writing %d bytes to %s.\n", 0x0F, dumpfile);
+#endif
write_dump(0, 0x0F, crafted, dumpfile, 1);
}
} else {