Nico Huber would like Stefan Reinauer to review this change.

View Change

dmi: Don't print dmidecode shell error

Don't print the error "sh: dmidecode: not found" if dmidecode is not there.
Uses stderr redirection to /dev/null (or NUL on win32).

Change-Id: I3ded8e1bad14b5e809185a79c4e3a17329b1ecb9
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
---
M dmi.c
1 file changed, 5 insertions(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/02/23802/1
diff --git a/dmi.c b/dmi.c
index 729cdb1..69b1d89 100644
--- a/dmi.c
+++ b/dmi.c
@@ -292,7 +292,11 @@
#else /* CONFIG_INTERNAL_DMI */

#define DMI_COMMAND_LEN_MAX 300
-static const char *dmidecode_command = "dmidecode";
+#if defined (_WIN32)
+static const char *dmidecode_command = "dmidecode.exe 2>NUL";
+#else
+static const char *dmidecode_command = "dmidecode 2>/dev/null";
+#endif

static char *get_dmi_string(const char *string_name)
{

To view, visit change 23802. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ded8e1bad14b5e809185a79c4e3a17329b1ecb9
Gerrit-Change-Number: 23802
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>