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

Dmitry Safonov 0x7f454c46 at gmail.com
Mon Apr 1 21:30:22 MSK 2019


Hi Zhang,

On 4/1/19 4:18 AM, ning.a.zhang at intel.com wrote:
> From: Zhang Ning <ning.a.zhang at intel.com>
> 
> criu/log.c:356:16: error: called object type 'int' is not a function or function pointer
>         int __errno = errno;
>                       ^~~~~
> /root/android-ndk/toolchains/llvm/prebuilt/linux-x86_64//sysroot/usr/include/errno.h:43:24: note: expanded from macro 'errno'
>                 ~~~~~~~^
> criu/log.c:391:2: error: called object type 'int' is not a function or function pointer
>         errno =  __errno;
>         ^~~~~
> /root/android-ndk/toolchains/llvm/prebuilt/linux-x86_64//sysroot/usr/include/errno.h:43:24: note: expanded from macro 'errno'
> 
> Cc: Chen Hu <hu1.chen at intel.com>
> Signed-off-by: Zhang Ning <ning.a.zhang at intel.com>> ---
>  criu/log.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/log.c b/criu/log.c
> index 060d1ee6..edd2511c 100644
> --- 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?
Could you add some details in commit message, please?

Thanks,
          Dmitry


More information about the CRIU mailing list