[virt-tools-list] [vhostmd PATCH 2/2] Fix access to dest_file

Jim Fehlig jfehlig at suse.com
Mon Dec 10 23:51:18 UTC 2018


On 12/7/18 11:12 AM, Michael Trapp wrote:
> ---
>   libmetrics/libmetrics.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libmetrics/libmetrics.c b/libmetrics/libmetrics.c
> index 0a5e3ee..36c7f5f 100644
> --- a/libmetrics/libmetrics.c
> +++ b/libmetrics/libmetrics.c
> @@ -681,8 +681,8 @@ int dump_metrics(const char *dest_file)
>       }
>   
>       if (fwrite(mdisk->buffer, 1, mdisk->length, fp) != mdisk->length) {
> -        libmsg("Error, unable to export metrics to file:%s - error:%s\n",
> -                dest_file, strerror(errno));
> +        libmsg("Error, unable to export metrics to file:%s - error:%s\n",
> +                dest_file ? dest_file : "stdout", strerror(errno));
>       }
>       if (dest_file)
>           fclose(fp);
> 

Trivial fix, thanks! I did change the commit summary before pushing

   Don't pass NULL string to library log function

Regards,
Jim




More information about the virt-tools-list mailing list