diff options
author | Alexander Amelkin <alexander@amelkin.msk.ru> | 2020-07-28 13:38:06 +0300 |
---|---|---|
committer | Alexander Amelkin <alexander@amelkin.msk.ru> | 2020-09-26 04:40:32 +0300 |
commit | 6d5eb2a9a93922fa5cfd1c767573964185fb9ba9 (patch) | |
tree | 16216061239c41e0441d59e5c0e184a5bdb60360 /lib/ipmi_hpmfwupg.c | |
parent | 1245aaa387dca1cb99408869b2c1b3e2410a1352 (diff) | |
download | ipmitool-bugfix/220-fix-gcc10.tar.gz |
hpmfwupg: Clean up / refactorbugfix/220-fix-gcc10
- Drop a useless `extern` definition
- Remove static variable `errorCount` from header, move it to
the c file where it is actually used if needed
Related to ipmitool/ipmitool#220
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Diffstat (limited to 'lib/ipmi_hpmfwupg.c')
-rw-r--r-- | lib/ipmi_hpmfwupg.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c index 07096ce..ea9072e 100644 --- a/lib/ipmi_hpmfwupg.c +++ b/lib/ipmi_hpmfwupg.c @@ -49,6 +49,23 @@ # include <config.h> #endif +/* + * This error code is used as a temporary PATCH to + * the latest Open ipmi driver. This PATCH + * will be removed once a new Open IPMI driver is released. + * (Buggy version = 39) + */ +#define ENABLE_OPENIPMI_V39_PATCH + +#ifdef ENABLE_OPENIPMI_V39_PATCH +# define RETRY_COUNT_MAX 3 +static int errorCount; +# define HPMFWUPG_IS_RETRYABLE(error) \ + ((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++<RETRY_COUNT_MAX))?TRUE:FALSE) +#else +# define HPMFWUPG_IS_RETRYABLE(error) FALSE +#endif + extern int verbose; VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX]; |