Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eh0Ft-0005JZ-Gv for mharc-grub-devel@gnu.org; Wed, 31 Jan 2018 16:49:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh0Fq-0005Ib-Fp for grub-devel@gnu.org; Wed, 31 Jan 2018 16:49:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh0Fl-0002YS-CP for grub-devel@gnu.org; Wed, 31 Jan 2018 16:49:18 -0500 Received: from cheddar.halon.org.uk ([93.93.131.118]:47170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eh0Fl-0002Wd-4N for grub-devel@gnu.org; Wed, 31 Jan 2018 16:49:13 -0500 Received: from bsmtp by cheddar.halon.org.uk with local-bsmtp (Exim 4.89) (envelope-from ) id 1eh0Fi-0002nm-GB; Wed, 31 Jan 2018 21:49:10 +0000 Received: from steve by tack.mossbank.org.uk with local (Exim 4.89) (envelope-from ) id 1eh0FD-000554-NI; Wed, 31 Jan 2018 21:48:39 +0000 Date: Wed, 31 Jan 2018 21:48:39 +0000 From: Steve McIntyre To: Daniel Kiper Cc: The development of GNU GRUB Subject: Re: [PATCH] Make grub-install check for errors from efibootmgr Message-ID: <20180131214830.ybmfmummnrb7ovm5@tack.einval.com> References: <20180129181626.eaprvd3pfbevjwvq@tack.einval.com> <20180129185423.29681-1-steve@einval.com> <20180130174405.GA11729@router-fw-old.local.net-space.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180130174405.GA11729@router-fw-old.local.net-space.pl> X-attached: none User-Agent: NeoMutt/20170113 (1.7.2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 93.93.131.118 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 21:49:19 -0000 On Tue, Jan 30, 2018 at 06:44:05PM +0100, Daniel Kiper wrote: >On Mon, Jan 29, 2018 at 06:54:23PM +0000, Steve McIntyre wrote: >> >> diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platform.c >> index a3fcfcaca..b3a617e44 100644 >> --- a/grub-core/osdep/unix/platform.c >> +++ b/grub-core/osdep/unix/platform.c >> @@ -78,19 +78,20 @@ get_ofpathname (const char *dev) >> dev); >> } >> >> -static void >> +static int >> grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) >> { >> int fd; >> pid_t pid = grub_util_exec_pipe ((const char * []){ "efibootmgr", NULL }, &fd); >> char *line = NULL; >> size_t len = 0; >> + int ret; >> >> if (!pid) >> { >> grub_util_warn (_("Unable to open stream from %s: %s"), >> "efibootmgr", strerror (errno)); >> - return; >> + return errno; >> } >> >> FILE *fp = fdopen (fd, "r"); >> @@ -98,14 +99,13 @@ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor) >> { >> grub_util_warn (_("Unable to open stream from %s: %s"), >> "efibootmgr", strerror (errno)); >> - return; >> + return errno; >> } >> >> line = xmalloc (80); >> len = 80; >> while (1) >> { >> - int ret; > >Oh, no, please do not do that here. If my first proposal conflicts with >existing variables use second one. If second is bad please choose third. >The rest of the patch LGTM. OK, no problem. New version on its way in a sec. -- Steve McIntyre, Cambridge, UK. steve@einval.com You raise the blade, you make the change... You re-arrange me 'til I'm sane...