Submitter | Stefan Tauner |
---|---|
Date | 2011-06-27 12:44:03 |
Message ID | <201106271243.p5RChekf006733@mail2.student.tuwien.ac.at> |
Download | mbox | patch |
Permalink | /patch/3217/ |
State | Under Review |
Headers | show |
Comments
Op 27-6-2011 14:44, Stefan Tauner schreef: > stepan told me to commit this, but i hesitate. i want to integrate > dos/win support first. > > i would drop the __DJGPP__ flag there because /dev/null is supported by > it: http://www.delorie.com/djgpp/doc/eli-m17n99.html#Unix%20devices > additionally i would use 2>NUL for win32. for xp there is official > documentation. a friend of mine also tried it on win2k so i would say > it is fairly safe to use it? It would be kind to be able to detect a missing DMIDECOD.EXE (DOS) or DMIDECODE.EXE (LFN platforms, likely thus only Windows/ReactOS) only once, instead of ending up with 6 times the line "bad command or filename" (sent to stdout only, unable to redirect to textfile). Searching current directory, flashrom's directory as well as entire path, should do, I guess.
On Mon, 27 Jun 2011 14:54:49 +0200 Bernd Blaauw <bblaauw@home.nl> wrote: > Op 27-6-2011 14:44, Stefan Tauner schreef: > > stepan told me to commit this, but i hesitate. i want to integrate > > dos/win support first. > > > > i would drop the __DJGPP__ flag there because /dev/null is supported by > > it: http://www.delorie.com/djgpp/doc/eli-m17n99.html#Unix%20devices > > additionally i would use 2>NUL for win32. for xp there is official > > documentation. a friend of mine also tried it on win2k so i would say > > it is fairly safe to use it? > > It would be kind to be able to detect a missing DMIDECOD.EXE (DOS) or > DMIDECODE.EXE (LFN platforms, likely thus only Windows/ReactOS) only > once, instead of ending up with > 6 times the line "bad command or filename" (sent to stdout only, unable > to redirect to textfile). does it with the previously attached patch still? > Searching current directory, flashrom's > directory as well as entire path, should do, I guess. patches are welcome ;)
Op 27-6-2011 15:29, Stefan Tauner schreef: > does it with the previously attached patch still? Can't say, I'm a simple Windows/Dos user, thus leeching on Idwer's DOS compilation. Someday I'll start with Linux and compiling, likely the day I purchase that Asrock E350M board for Coreboot attempting to create a 'full' opensource machine. >> Searching current directory, flashrom's >> directory as well as entire path, should do, I guess. > patches are welcome ;) Thanks for the offer :)
Patch
From a6e760c92186c7a6c8f7168ada0cfc7e2594f55d Mon Sep 17 00:00:00 2001 From: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Date: Mon, 27 Jun 2011 14:41:46 +0200 Subject: [PATCH] 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). Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> --- dmi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dmi.c b/dmi.c index cda6656..318d89e 100644 --- a/dmi.c +++ b/dmi.c @@ -75,7 +75,11 @@ static const struct { }; #define DMI_COMMAND_LEN_MAX 260 -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 *dmistrings[ARRAY_SIZE(dmidecode_names)]; -- 1.7.1