From 5c1917e08d87cd11a1c0c86672bb9ed3e9b0a42d Mon Sep 17 00:00:00 2001 From: "Jonathan M. Henson" Date: Thu, 5 Oct 2023 16:30:00 -0700 Subject: [PATCH] dont need all those functions for an internal api. --- include/aws/common/private/system_info_priv.h | 4 ---- source/linux/system_info.c | 13 ++++--------- source/system_info.c | 3 --- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/include/aws/common/private/system_info_priv.h b/include/aws/common/private/system_info_priv.h index dbfd2d782..46760cea4 100644 --- a/include/aws/common/private/system_info_priv.h +++ b/include/aws/common/private/system_info_priv.h @@ -22,8 +22,4 @@ struct aws_system_environment { int aws_system_environment_load_platform_impl(struct aws_system_environment *env); void aws_system_environment_destroy_platform_impl(struct aws_system_environment *env); - -void aws_system_environment_load_virtualization_vendor_impl(struct aws_system_environment *env); -void aws_system_environment_load_virtualization_product_name_impl(struct aws_system_environment *env); - #endif /* AWS_COMMON_SYSTEM_INFO_PRIV_H */ diff --git a/source/linux/system_info.c b/source/linux/system_info.c index 6879bff43..c39545c23 100644 --- a/source/linux/system_info.c +++ b/source/linux/system_info.c @@ -3,19 +3,14 @@ #include int aws_system_environment_load_platform_impl(struct aws_system_environment *env) { - (void)env; + aws_byte_buf_init_from_file(&env->virtualization_vendor, env->allocator, "/sys/devices/virtual/dmi/id/sys_vendor"); + aws_byte_buf_init_from_file(&env->product_name, env->allocator, "/sys/devices/virtual/dmi/id/product_name"); return AWS_OP_SUCCESS; } void aws_system_environment_destroy_platform_impl(struct aws_system_environment *env) { - (void)env; + aws_byte_buf_clean_up(&env->virtualization_vendor); + aws_byte_buf_clean_up(&env->product_name); } -void aws_system_environment_load_virtualization_vendor_impl(struct aws_system_environment *env) { - aws_byte_buf_init_from_file(&env->virtualization_vendor, env->allocator, "/sys/devices/virtual/dmi/id/sys_vendor"); -} - -void aws_system_environment_load_virtualization_product_name_impl(struct aws_system_environment *env) { - aws_byte_buf_init_from_file(&env->product_name, env->allocator, "/sys/devices/virtual/dmi/id/product_name"); -} diff --git a/source/system_info.c b/source/system_info.c index a2247a56f..e4b08a77e 100644 --- a/source/system_info.c +++ b/source/system_info.c @@ -12,9 +12,6 @@ struct aws_system_environment *aws_system_environment_load(struct aws_allocator goto error; } - aws_system_environment_load_virtualization_vendor_impl(env); - aws_system_environment_load_virtualization_product_name_impl(env); - env->os = aws_get_platform_build_os(); env->cpu_count = aws_system_info_processor_count(); env->cpu_group_count = aws_get_cpu_group_count();