Skip to content

Commit

Permalink
Corrections for fu-efivar-freebsd.c
Browse files Browse the repository at this point in the history
There were some compilation warnings (one actual error) and possibility
to use incorrect efivar library.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
  • Loading branch information
SergiiDmytruk authored and hughsie committed Jun 15, 2021
1 parent bda57e8 commit c16602d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions libfwupdplugin/fu-efivar-freebsd.c
Expand Up @@ -11,6 +11,7 @@

#include <efivar.h>

#include "fu-common.h"
#include "fu-efivar-impl.h"

#include "fwupd-error.h"
Expand Down Expand Up @@ -55,7 +56,7 @@ fu_efivar_delete_with_glob_impl (const gchar *guid, const gchar *name_glob, GErr
efi_str_to_guid (guid, &guid_to_delete);

while (efi_get_next_variable_name (&guidt, &name)) {
if (memcmp (&guid_to_delete, guidt, sizeof (guidt)) != 0)
if (memcmp (&guid_to_delete, guidt, sizeof (guid_to_delete)) != 0)
continue;
if (!fu_common_fnmatch (name, name_glob))
continue;
Expand Down Expand Up @@ -105,7 +106,6 @@ fu_efivar_get_data_impl (const gchar *guid, const gchar *name, guint8 **data,
GPtrArray *
fu_efivar_get_names_impl (const gchar *guid, GError **error)
{
const gchar *name_guid;
g_autoptr(GPtrArray) names = g_ptr_array_new_with_free_func (g_free);
efi_guid_t *guidt = NULL;
gchar *name = NULL;
Expand Down Expand Up @@ -172,7 +172,7 @@ fu_efivar_set_data_impl (const gchar *guid, const gchar *name, const guint8 *dat
efi_guid_t guidt;
efi_str_to_guid (guid, &guidt);

if (efi_set_variable (guidt, name, data, sz, attr) != 0) {
if (efi_set_variable (guidt, name, (guint8 *)data, sz, attr) != 0) {
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Expand Up @@ -285,7 +285,7 @@ if get_option('default_library') != 'static'
platform_deps += cc.find_library('shlwapi')
endif
if host_machine.system() == 'freebsd'
platform_deps += cc.find_library('efivar')
platform_deps += dependency('efivar')
endif
endif

Expand Down

0 comments on commit c16602d

Please sign in to comment.