Fix a bug in HBA_LoadLibrary(), where it does not report the error if no library has been actually loaded successfully. For example, a incorrect hba.conf file with an invalid library name, the HBA_LoadLirary will still return ok.
Signed-off-by: Yi Zou <[email protected]> --- hbaapi2.2.patch | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hbaapi2.2.patch b/hbaapi2.2.patch index 2af09da..83a25f6 100644 --- a/hbaapi2.2.patch +++ b/hbaapi2.2.patch @@ -1,5 +1,5 @@ ---- HBAAPILIB.c 2009-02-24 11:19:05.000000000 -0800 -+++ HBAAPILIB.c 2009-02-24 11:19:17.000000000 -0800 +--- HBAAPILIB.c 2010-01-21 16:46:34.000000000 -0800 ++++ HBAAPILIB.c 2010-01-21 16:51:13.000000000 -0800 @@ -37,8 +37,12 @@ */ #define HBAAPI_EXPORTS @@ -13,3 +13,21 @@ #endif #include <stdio.h> #include <time.h> +@@ -859,8 +863,15 @@ + InitializeCriticalSection(&_hbaapi_LE_mutex); + #endif + +- +- return HBA_STATUS_OK; ++ /* At least one lib must be loaded */ ++ status = HBA_STATUS_ERROR; ++ for(lib_infop = _hbaapi_librarylist; lib_infop != NULL; lib_infop = lib_infop->next) { ++ if (lib_infop->status == HBA_LIBRARY_LOADED) { ++ status = HBA_STATUS_OK; ++ break; ++ } ++ } ++ return status; + } + + HBA_STATUS _______________________________________________ devel mailing list [email protected] http://www.open-fcoe.org/mailman/listinfo/devel
