From 273f2cac2e23bac9785a81f82346303aeb407a42 Mon Sep 17 00:00:00 2001 From: Anton Kikin Date: Wed, 22 Feb 2023 09:53:17 +0300 Subject: [PATCH 1/3] Build frugen with shared library instead of static Signed-off-by: Anton Kikin --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 686e2ca..ee32308 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ add_library(fru-shared SHARED fru.c) find_library(JSON_LIB json-c) SET_TARGET_PROPERTIES(fru-static PROPERTIES OUTPUT_NAME fru CLEAN_DIRECT_OUTPUT 1) SET_TARGET_PROPERTIES(fru-shared PROPERTIES OUTPUT_NAME fru CLEAN_DIRECT_OUTPUT 1) -target_link_libraries(frugen fru-static) +target_link_libraries(frugen fru-shared) target_link_libraries(frugen-static fru-static -static) if (JSON_LIB) message (STATUS "Using JSON Library found at " ${JSON_LIB}) From a982b1a5d51fc4aec4874875f68a42bd027d47b1 Mon Sep 17 00:00:00 2001 From: Anton Kikin Date: Wed, 22 Feb 2023 09:54:24 +0300 Subject: [PATCH 2/3] Fix invalid memcmp size Signed-off-by: Anton Kikin --- fru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fru.c b/fru.c index db08a47..1debc26 100644 --- a/fru.c +++ b/fru.c @@ -495,7 +495,7 @@ fru_info_area_t *fru_create_info_area(fru_area_type_t atype, ///< [in] Area t * It's assumed here that UNIX time 0 (Jan 1st of 1970) * can never actually happen in a FRU file in 2018. */ - if (!memcmp(&tv_unspecified, tv, sizeof(tv))) { + if (!memcmp(&tv_unspecified, tv, sizeof(*tv))) { printf("Using FRU_DATE_UNSPECIFIED\n"); fru_time = FRU_DATE_UNSPECIFIED; } else { From 13429792571361cdb391901602e6f684f3af4064 Mon Sep 17 00:00:00 2001 From: Anton Kikin Date: Wed, 22 Feb 2023 09:55:46 +0300 Subject: [PATCH 3/3] Fix invalid arguments when calling fatal() Signed-off-by: Anton Kikin --- frugen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frugen.c b/frugen.c index 5e8b5dd..6cc2f98 100644 --- a/frugen.c +++ b/frugen.c @@ -192,7 +192,7 @@ bool json_fill_fru_area_fields(json_object *jso, int count, const char *type = json_object_get_string(typefield); const char *val = json_object_get_string(valfield); if (!strcmp("binary", type)) { - fatal(1, "Binary format not yet implemented"); + fatal("Binary format not yet implemented"); } else if (!strcmp("bcdplus", type)) { fields[i]->type = FIELD_TYPE_BCDPLUS; } else if (!strcmp("6bitascii", type)) {