[CRIU] [PATCH 1/2] fix build issue under Android NDK

Dmitry Safonov 0x7f454c46 at gmail.com
Mon Apr 1 22:35:50 MSK 2019


On 4/1/19 8:32 PM, Radostin Stoyanov wrote:
> On 01/04/2019 19:30, Dmitry Safonov wrote:
>> On 4/1/19 4:18 AM, ning.a.zhang at intel.com wrote:
>>> --- a/criu/log.c
>>> +++ b/criu/log.c
>>> @@ -353,7 +353,7 @@ static void early_vprint(const char *format, unsigned int loglevel, va_list para
>>>  void vprint_on_level(unsigned int loglevel, const char *format, va_list params)
>>>  {
>>>  	int fd, size, ret, off = 0;
>>> -	int __errno = errno;
>>> +	int _errno = errno;
>>>  
>>>  	if (unlikely(loglevel == LOG_MSG)) {
>>>  		fd = STDOUT_FILENO;
>>> @@ -388,7 +388,7 @@ void vprint_on_level(unsigned int loglevel, const char *format, va_list params)
>>>  	if (loglevel == LOG_ERROR)
>>>  		log_note_err(buffer + buf_off);
>>>  
>>> -	errno =  __errno;
>>> +	errno =  _errno;
>>>  }
>>>  
>>>  void print_on_level(unsigned int loglevel, const char *format, ...)
>>>
>> I'm not sure I understand how renaming helps fixing anything here..
>> Is there a macro named __errno in Android SDK?
> https://android.googlesource.com/platform/development/+/3ccf4f2/ndk/platforms/android-3/include/errno.h#44

I see, I'm not against, but I prefer changelog to mention that.
Also, probably, worth to fix all places with one patch?

[criu]$ git grep __errno
criu/log.c:     int __errno = errno;
criu/log.c:     errno =  __errno;
test/zdtm/lib/msg.c:    int __errno = errno;
test/zdtm/lib/msg.c:    errno = __errno;

Thanks,
          Dmitry


More information about the CRIU mailing list