[CRIU] [PATCH 2/4] zdtm: fix compilation in test_msg()

Andrew Vagin avagin at parallels.com
Wed Sep 12 04:00:36 EDT 2012


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

On Wed, Sep 12, 2012 at 11:48:40AM +0400, Konstantin Khlebnikov wrote:
> cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0   -c -o msg.o msg.c
> msg.c: In function ‘test_msg’:
> msg.c:40:6: error: variable ‘len’ set but not used [-Werror=unused-but-set-variable]
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
> ---
>  test/zdtm/lib/msg.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/test/zdtm/lib/msg.c b/test/zdtm/lib/msg.c
> index de9185b..17a298e 100644
> --- a/test/zdtm/lib/msg.c
> +++ b/test/zdtm/lib/msg.c
> @@ -37,7 +37,7 @@ int test_log_init(const char *fname, const char *suffix)
>  void test_msg(const char *format, ...)
>  {
>  	va_list arg;
> -	int len, off = 0;
> +	int off = 0;
>  	char buf[PAGE_SIZE];
>  	struct timeval tv;
>  	struct tm *tm;
> @@ -53,7 +53,7 @@ void test_msg(const char *format, ...)
>  	off += sprintf(buf + off, ".%.3ld: ", tv.tv_usec / 1000);
>  	off += sprintf(buf + off, "%5d: ", getpid());
>  	va_start(arg, format);
> -	len = vsnprintf(buf + off, sizeof(buf) - off, format, arg);
> +	off += vsnprintf(buf + off, sizeof(buf) - off, format, arg);
>  	va_end(arg);
>  
>  	fprintf(stderr, buf);
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list