Skip to content

Commit

Permalink
dont need all those functions for an internal api.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHenson committed Oct 5, 2023
1 parent 6a7c30c commit 5c1917e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 0 additions & 4 deletions include/aws/common/private/system_info_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
13 changes: 4 additions & 9 deletions source/linux/system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
#include <aws/common/file.h>

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");
}
3 changes: 0 additions & 3 deletions source/system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5c1917e

Please sign in to comment.