From 80967c8e1c64f16ef3b2d9d3457743d4ef50b38d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 3 Mar 2017 20:22:56 +0000 Subject: Only compile the known uuid table once. Sponsored by: Netflix --- lib/libefivar/efivar.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libefivar/efivar.c') diff --git a/lib/libefivar/efivar.c b/lib/libefivar/efivar.c index a0f51f1135f8..50e11940d30e 100644 --- a/lib/libefivar/efivar.c +++ b/lib/libefivar/efivar.c @@ -88,7 +88,10 @@ efi_guid_tbl_compile(void) { size_t i; uint32_t status; + static int done = 0; + if (done) + return; for (i = 0; i < nitems(guid_tbl); i++) { uuid_from_string(guid_tbl[i].uuid_str, &guid_tbl[i].guid, &status); @@ -97,6 +100,7 @@ efi_guid_tbl_compile(void) fprintf(stderr, "Can't convert %s to a uuid for %s: %d\n", guid_tbl[i].uuid_str, guid_tbl[i].name, (int)status); } + done = 1; } int -- cgit v1.2.3