[CRIU] [PATCH 2/4] zdtm: Don't modify global @errno in test_msg

Andrew Vagin avagin at parallels.com
Thu Mar 26 01:45:48 PDT 2015


Acked-by: Andrew Vagin <avagin at parallels.com>

On Thu, Mar 26, 2015 at 11:23:13AM +0300, Cyrill Gorcunov wrote:
> This is logging routine, lets it not affect the global @errno.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  test/zdtm/lib/msg.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/test/zdtm/lib/msg.c b/test/zdtm/lib/msg.c
> index 8a80ae2244c0..48ddd43e0906 100644
> --- a/test/zdtm/lib/msg.c
> +++ b/test/zdtm/lib/msg.c
> @@ -39,6 +39,7 @@ void test_msg(const char *format, ...)
>  	va_list arg;
>  	int off = 0;
>  	char buf[PAGE_SIZE];
> +	int __errno = errno;
>  	struct timeval tv;
>  	struct tm *tm;
>  
> @@ -57,4 +58,5 @@ void test_msg(const char *format, ...)
>  	va_end(arg);
>  
>  	fprintf(stderr, "%s", buf);
> +	errno = __errno;
>  }
> -- 
> 1.9.3
> 


More information about the CRIU mailing list