From owner-svn-src-head@freebsd.org Fri Mar 3 20:22:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAAEDCF7190; Fri, 3 Mar 2017 20:22:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 983531DB0; Fri, 3 Mar 2017 20:22:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v23KMuKh063082; Fri, 3 Mar 2017 20:22:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v23KMu6E063081; Fri, 3 Mar 2017 20:22:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703032022.v23KMu6E063081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 Mar 2017 20:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314616 - head/lib/libefivar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 20:22:57 -0000 Author: imp Date: Fri Mar 3 20:22:56 2017 New Revision: 314616 URL: https://svnweb.freebsd.org/changeset/base/314616 Log: Only compile the known uuid table once. Sponsored by: Netflix Modified: head/lib/libefivar/efivar.c Modified: head/lib/libefivar/efivar.c ============================================================================== --- head/lib/libefivar/efivar.c Fri Mar 3 20:22:47 2017 (r314615) +++ head/lib/libefivar/efivar.c Fri Mar 3 20:22:56 2017 (r314616) @@ -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