void-packages/srcpkgs/efivar/patches/portability.patch

28 lines
1 KiB
Diff

Portability fixes:
- Initialize outbuf with the expected size! fixes a segfault with musl.
- Really use __builtin_va_arg_pack_len().
--- src/makeguids.c 2014-12-28 10:30:36.731270900 +0100
+++ src/makeguids.c 2014-12-28 10:26:24.743259656 +0100
@@ -100,7 +100,7 @@ main(int argc, char *argv[])
err(1, "makeguids: could not read \"%s\"", argv[1]);
/* strictly speaking, this *has* to be too large. */
- struct guidname *outbuf = calloc(inlen, sizeof (char));
+ struct guidname *outbuf = calloc(inlen, sizeof (struct guidname));
if (!outbuf)
err(1, "makeguids");
--- src/efivar.h 2014-12-28 10:30:36.731270900 +0100
+++ src/efivar.h 2014-12-28 10:26:57.359261112 +0100
@@ -85,7 +85,7 @@ efi_set_variable(efi_guid_t guid, const
return -1;
}
- if (__va_arg_pack_len() == 0)
+ if (__builtin_va_arg_pack_len() == 0)
return _efi_set_variable(guid, name, data, data_size,
attributes, 0644);