From 71cc1e78fd81818428cbd1b55fcf096979b529ef Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 16 Oct 2021 11:04:17 -0400 Subject: [PATCH] Open_plugins.c bugfix address of packed struct element helpful gcc warning after g#3895 change to packed struct Change-Id: I89f765da94eeee14c606ea8ebaab5e219dceb2ac --- apps/plugins/open_plugins.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/plugins/open_plugins.c b/apps/plugins/open_plugins.c index d479bbd31c..b8d11d2ae5 100644 --- a/apps/plugins/open_plugins.c +++ b/apps/plugins/open_plugins.c @@ -296,6 +296,7 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha { int len; uint32_t hash; + uint32_t newhash; char *pos = "";; int fd_tmp = -1; use_key = (use_key == true && key != NULL); @@ -309,7 +310,8 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha { /* need to keep the old hash so we can remove the old entry */ hash = op_entry.hash; - open_plugin_get_hash(plugin, &op_entry.hash); + open_plugin_get_hash(plugin, &newhash); + op_entry.hash = newhash; } else hash = op_entry.hash; @@ -352,7 +354,10 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha /* hash on the parameter path if it is a file */ if (op_entry.lang_id <0 && key == op_entry.path && rb->file_exists(op_entry.param)) - open_plugin_get_hash(op_entry.path, &op_entry.hash); + { + open_plugin_get_hash(op_entry.path, &newhash); + op_entry.hash = newhash; + } } rb->write(fd_tmp, &op_entry, op_entry_sz); /* add new entry first */