[ostree] libostree: Fix crash if output is not a tty



commit b6b7d37c9d15f0211a39687fd72d9c7c350dfa2c
Author: Colin Walters <walters verbum org>
Date:   Fri Mar 14 21:59:35 2014 -0400

    libostree: Fix crash if output is not a tty
    
    This was a recent regression.

 src/libostree/ostree-repo-pull.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 6776a2a..194c4ad 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1245,7 +1245,10 @@ ostree_repo_pull (OstreeRepo               *self,
                              (guint64)(bytes_transferred / shift),
                              shift == 1 ? "B" : "KiB",
                              (guint) ((end_time - start_time) / G_USEC_PER_SEC));
-      ostree_async_progress_set_status (pull_data->progress, msg);
+      if (pull_data->progress)
+        ostree_async_progress_set_status (pull_data->progress, msg);
+      else
+        g_print ("%s\n", msg);
     }
 
   ret = TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]