grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Make grub-install check for errors from efibootmgr


From: Steve McIntyre
Subject: Re: [PATCH] Make grub-install check for errors from efibootmgr
Date: Wed, 31 Jan 2018 21:48:39 +0000
User-agent: NeoMutt/20170113 (1.7.2)

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.                                address@hidden
You raise the blade, you make the change... You re-arrange me 'til I'm sane...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]