grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 1/2] Add grub_util_readlink()


From: Javier Martinez Canillas
Subject: Re: [PATCH v3 1/2] Add grub_util_readlink()
Date: Fri, 13 Dec 2019 15:44:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

Hello Daniel,

On 11/5/19 12:42 PM, Daniel Kiper wrote:

[snip]

>> --- grub-core/osdep/windows/hostdisk.c
>> +++ grub-core/osdep/windows/hostdisk.c
>> @@ -365,6 +365,12 @@ grub_util_mkdir (const char *dir)
>>    free (windows_name);
>>  }
>>
>> +ssize_t
>> +grub_util_readlink (const char *name, char *buf, size_t bufsize)
>> +{
>> +  return readlink(name, buf, bufsize);
>> +}
>> +
>>  int
>>  grub_util_rename (const char *from, const char *to)
>>  {
> 
> This change breaks Windows build. I think that you should drop it and
> do some #ifdefery in patch #2. I mean I would leave existing code for
> Windows only and add new code for POSIX compliant systems.
>

Ok, will do.
 
[snip]

>>  #if defined (__NetBSD__)
>> diff --git include/grub/osdep/hostfile_windows.h 
>> include/grub/osdep/hostfile_windows.h
>> index bf6451b6db4..8c92d0591bb 100644
>> --- include/grub/osdep/hostfile_windows.h
>> +++ include/grub/osdep/hostfile_windows.h
>> @@ -41,6 +41,8 @@ typedef struct grub_util_fd_dir *grub_util_fd_dir_t;
>>
>>  int
>>  grub_util_rename (const char *from, const char *to);
>> +ssize_t
>> +grub_util_readlink (const char *name, char *buf, size_t bufsize);
>>  int
>>  grub_util_unlink (const char *name);
>>  void
> 
> This change is also probably not needed then...
>

Do we really need this grub_util_readlink() indirection level then?
Can the #ifdef code for POSIX just use readlink(2) directly?
 
Best regards,
-- 
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat




reply via email to

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