[Pkg-libvirt-commits] [libguestfs] 04/66: make-fs: Check for error return from guestfs_statvfs.

Hilko Bengen bengen at moszumanska.debian.org
Fri May 9 12:56:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit 254a5e91121e83f86d1853a6f7dac327db6d819e
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Mar 28 13:59:56 2014 +0000

    make-fs: Check for error return from guestfs_statvfs.
    
    Found by Coverity.
    
    (cherry picked from commit 410aae4b6f646e1fc20b82d24486c68f0c09916c)
---
 make-fs/make-fs.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/make-fs/make-fs.c b/make-fs/make-fs.c
index 974eeb7..f931d21 100644
--- a/make-fs/make-fs.c
+++ b/make-fs/make-fs.c
@@ -212,19 +212,20 @@ print_stats (guestfs_h *g, const char *before_or_after)
     return;
 
   CLEANUP_FREE_STATVFS struct guestfs_statvfs *stats = guestfs_statvfs (g, "/");
-
-  fprintf (stderr, "%s uploading:\n", before_or_after);
-  fprintf (stderr, "  bsize = %" PRIi64 "\n", stats->bsize);
-  fprintf (stderr, "  frsize = %" PRIi64 "\n", stats->frsize);
-  fprintf (stderr, "  blocks = %" PRIi64 "\n", stats->blocks);
-  fprintf (stderr, "  bfree = %" PRIi64 "\n", stats->bfree);
-  fprintf (stderr, "  bavail = %" PRIi64 "\n", stats->bavail);
-  fprintf (stderr, "  files = %" PRIi64 "\n", stats->files);
-  fprintf (stderr, "  ffree = %" PRIi64 "\n", stats->ffree);
-  fprintf (stderr, "  favail = %" PRIi64 "\n", stats->favail);
-  fprintf (stderr, "  fsid = %" PRIi64 "\n", stats->fsid);
-  fprintf (stderr, "  flag = %" PRIi64 "\n", stats->flag);
-  fprintf (stderr, "  namemax = %" PRIi64 "\n", stats->namemax);
+  if (stats) {
+    fprintf (stderr, "%s uploading:\n", before_or_after);
+    fprintf (stderr, "  bsize = %" PRIi64 "\n", stats->bsize);
+    fprintf (stderr, "  frsize = %" PRIi64 "\n", stats->frsize);
+    fprintf (stderr, "  blocks = %" PRIi64 "\n", stats->blocks);
+    fprintf (stderr, "  bfree = %" PRIi64 "\n", stats->bfree);
+    fprintf (stderr, "  bavail = %" PRIi64 "\n", stats->bavail);
+    fprintf (stderr, "  files = %" PRIi64 "\n", stats->files);
+    fprintf (stderr, "  ffree = %" PRIi64 "\n", stats->ffree);
+    fprintf (stderr, "  favail = %" PRIi64 "\n", stats->favail);
+    fprintf (stderr, "  fsid = %" PRIi64 "\n", stats->fsid);
+    fprintf (stderr, "  flag = %" PRIi64 "\n", stats->flag);
+    fprintf (stderr, "  namemax = %" PRIi64 "\n", stats->namemax);
+  }
 }
 
 /* Execute a command, sending output to a file. */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list