Menu

#103 'lib/ipmi_ekanalyzer.c' needs a re-work

version-cvs
open-accepted
nobody
None
5
2017-04-26
2012-05-20
No

There are couple things in 'lib/ipmi_ekanalyzer.c' that would use re-work. I've noticed only print-outs.

Why???

static void
ipmi\_ekanalyzer\_usage\( void \)
\{
char \* help\_message =
"Ekeying analyzer tool version 1.00                                        \n\
ekanalyzer Commands:                                                       \n\
print    \[carrier | power | all\] <oc=filename1> <b1=filename2>...    \n\
frushow  <b2=filename>                                               \n\
summary  \[match | unmatch | all\] <oc=filename1> <b1=filename2>...    \n\
";
printf\("%s",help\_message\);
fflush\(stdout\);
\}

Typo _argumentS_ + Repetitive -> create function:

printf\("Too few argument\! \n"\);
if \( strcmp\(argv\[argument\_offset\], "print"\) == 0 \)\{
lprintf\(LOG\_ERR, "   ekanalyzer print \[carrier/power/all\]"
" <xx=frufile> <xx=frufile> \[xx=frufile\]"
\);
\}
else\{
lprintf\(LOG\_ERR, "   ekanalyzer summary \[match/ unmatch/ all\]"
" <xx=frufile> <xx=frufile> \[xx=frufile\]"
\);
\}

Should be at STDERR:

printf\("Too few argument\! \n"\);
\[...\]
printf\("Invalid option '%s'\n", argv\[argument\_offset\]\);
\[...\]
if \( \!found\_flag \)\{
printf\("No carrier file has been found\n"\);
return\_value = ERROR\_STATUS;
\}
\[...\]
if \( amc\_file == FALSE \)\{
printf\("\nNo AMC FRU file is provided --->" \
" No possible ekeying match\!\n"\);
return\_value = ERROR\_STATUS;
\}
\[...\]
if \( \!oc\_file \)\{
printf\("\nNo Carrier FRU file is provided" \
" ---> No possible ekeying match\!\n"\);
return\_value = ERROR\_STATUS;
\}
\[...\]
else\{
printf\("No amc record is found\!\n"\);
\}
\[...\]
if \( record == NULL \)\{
printf\("NO Carrier p2p connectivity \!\n"\);
return\_status = ERROR\_STATUS;
\}

Perhaps there is more. There is some debug information passed straight to STDOUT; I think it should go to STDERR.

Discussion

  • Zdenek Styblik

    Zdenek Styblik - 2013-05-29
    • milestone: --> version-1.8.12
     
  • Zdenek Styblik

    Zdenek Styblik - 2013-08-18
    • Group: version-1.8.13 --> version-1.8.14
     
  • Zdenek Styblik

    Zdenek Styblik - 2014-05-19
    • status: open --> open-accepted
    • assigned_to: Zdenek Styblik
     
  • Zdenek Styblik

    Zdenek Styblik - 2014-05-19
    • Group: version-1.8.14 --> version-1.8.15
     
  • Zdenek Styblik

    Zdenek Styblik - 2015-03-11
    • Group: version-1.8.15 --> version-cvs
     
  • Zdenek Styblik

    Zdenek Styblik - 2017-04-26
    • assigned_to: Zdenek Styblik --> nobody
     

Log in to post a comment.