]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: add FDISK_DEBUG_FRONTEND
authorKarel Zak <kzak@redhat.com>
Tue, 21 May 2013 13:30:16 +0000 (15:30 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Sep 2013 14:46:56 +0000 (16:46 +0200)
Currently we use private libfdisk in fdisk code, because the library
API is not stable yet. Let's add debug flag to make it obvious in the
debug output what is from libfdisk and what is from fdisk frontend.

Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/fdisk-menu.c
libfdisk/src/fdiskP.h

index b8cea823731e5cd7e575fb490c2d4e5c13437059..0ea3dc1d31b4217cb2380ac13e00c873d0d61c7e 100644 (file)
@@ -266,15 +266,15 @@ static int menu_detect_collisions(struct fdisk_context *cxt)
 
                r = get_fdisk_menu_entry(cxt, e->key, NULL);
                if (!r) {
-                       DBG(CONTEXT, dbgprint("warning: not found "
+                       DBG(FRONTEND, dbgprint("warning: not found "
                                        "entry for %c", e->key));
                        return -1;
                }
                if (r != e) {
-                       DBG(CONTEXT, dbgprint("warning: duplicate key '%c'",
+                       DBG(FRONTEND, dbgprint("warning: duplicate key '%c'",
                                                e->key));
-                       DBG(CONTEXT, dbgprint("         %s", e->title));
-                       DBG(CONTEXT, dbgprint("         %s", r->title));
+                       DBG(FRONTEND, dbgprint("         %s", e->title));
+                       DBG(FRONTEND, dbgprint("         %s", r->title));
                        abort();
                }
        }
@@ -287,7 +287,7 @@ int print_fdisk_menu(struct fdisk_context *cxt)
        struct menu_context mc = MENU_CXT_EMPTY;
        const struct menu_entry *e;
 
-       ON_DBG(CONTEXT, menu_detect_collisions(cxt));
+       ON_DBG(FRONTEND, menu_detect_collisions(cxt));
 
        if (fdisk_context_display_details(cxt))
                printf(_("\nHelp (expert commands):\n"));
@@ -340,7 +340,7 @@ int process_fdisk_menu(struct fdisk_context *cxt)
                return -EINVAL;
        }
 
-       DBG(CONTEXT, dbgprint("selected: key=%c, entry='%s'",
+       DBG(FRONTEND, dbgprint("selected: key=%c, entry='%s'",
                                key, ent->title));
        /* hardcoded help */
        if (key == 'm') {
@@ -370,7 +370,7 @@ static int gpt_menu_cb(struct fdisk_context *cxt,
        assert(ent);
        assert(fdisk_is_disklabel(cxt, GPT));
 
-       DBG(CONTEXT, dbgprint("enter GPT menu"));
+       DBG(FRONTEND, dbgprint("enter GPT menu"));
 
        rc = fdisk_ask_partnum(cxt, &n, FALSE);
        if (rc)
index 1114f8cf106636f19778ace2c06d2def41aaa963..6a184a0b7d10b05d63c0ca3a41029422af27312b 100644 (file)
@@ -49,6 +49,7 @@
 #define FDISK_DEBUG_GEOMETRY    (1 << 4)
 #define FDISK_DEBUG_LABEL       (1 << 5)
 #define FDISK_DEBUG_ASK         (1 << 6)
+#define FDISK_DEBUG_FRONTEND   (1 << 7)
 #define FDISK_DEBUG_ALL                0xFFFF
 
 # define ON_DBG(m, x)  do { \