[gnome-multi-writer] trivial: Return the reported size in the sanity check error



commit 5f6677c2ddc55df2a837fa3fa5ab1ebdbe26eb26
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jan 29 15:01:34 2015 +0000

    trivial: Return the reported size in the sanity check error

 src/gmw-probe.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/gmw-probe.c b/src/gmw-probe.c
index ed94d43..52bab33 100644
--- a/src/gmw-probe.c
+++ b/src/gmw-probe.c
@@ -38,8 +38,9 @@
 
 #include "gmw-cleanup.h"
 
-#define ONE_MB                 (1024 * 1024)
-#define ONE_BLOCK              (32 * 1024)
+#define ONE_BLOCK              0x8000
+#define ONE_MB                 0x100000
+#define ONE_GB                 0x40000000
 
 typedef struct {
        guint8                  *data_old;
@@ -356,10 +357,12 @@ gmw_probe_scan_device (GmwProbeDevice *dev, GCancellable *cancellable, GError **
                return FALSE;
        }
        if (dev->disk_size > 0x800000000llu) {
-               g_set_error_literal (error,
-                                    GMW_ERROR,
-                                    GMW_ERROR_FAILED,
-                                    "Disk capacity reported as invalid");
+               g_set_error (error,
+                            GMW_ERROR,
+                            GMW_ERROR_FAILED,
+                            "Disk capacity reported as invalid: %"
+                            G_GUINT64_FORMAT "MB",
+                            dev->disk_size / ONE_MB);
                return FALSE;
        }
        g_debug ("Disk reports to be %luMB in size", dev->disk_size / ONE_MB);


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