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

Michael Trapp Michael.Trapp at sap.com
Fri Dec 7 18:12:40 UTC 2018


---
 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);
-- 
2.17.2 (Apple Git-113)




More information about the virt-tools-list mailing list