]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: use debug stuff from libfdisk
authorKarel Zak <kzak@redhat.com>
Fri, 30 Nov 2012 14:29:03 +0000 (15:29 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Mar 2013 10:20:40 +0000 (11:20 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/Makemodule.am
fdisks/fdisk.h

index e03ccbe6e9d57eecc2fc8b75b4f9560aa268d031..69445354297c6d21be1ee9c3e2669a4fb977f74f 100644 (file)
@@ -25,8 +25,8 @@ fdisk_SOURCES = \
        fdisks/utils.c \
        fdisks/common.h
 
-fdisk_LDADD = $(LDADD) libcommon.la
-fdisk_CFLAGS = $(AM_CFLAGS)
+fdisk_LDADD = $(LDADD) libcommon.la libfdisk.la
+fdisk_CFLAGS = $(AM_CFLAGS) -I$(ul_libfdisk_incdir)
 
 if BUILD_LIBBLKID
 fdisk_CFLAGS += -I$(ul_libblkid_incdir)
index 3cb04993e7c547710d07ce1cfba9e44369991bae..14b0a7a6a248ddad776fa3ef2de10e4bb8361e18 100644 (file)
@@ -4,6 +4,12 @@
 
 #include "c.h"
 
+/* Let's temporary include private libfdisk header file. The final libfdisk.h
+ * maybe included when fdisk.c and libfdisk code will be completely spit.
+ */
+#include "fdiskP.h"
+
+
 #define DEFAULT_SECTOR_SIZE    512
 #define MAX_SECTOR_SIZE        2048
 #define SECTOR_SIZE    512     /* still used in BSD code */
 #define cround(n)      (display_in_cyl_units ? ((n)/units_per_sector)+1 : (n))
 #define scround(x)     (((x)+units_per_sector-1)/units_per_sector)
 
-/* fdisk debugging flags/options */
-#define FDISK_DEBUG_INIT       (1 << 1)
-#define FDISK_DEBUG_CONTEXT    (1 << 2)
-#define FDISK_DEBUG_TOPOLOGY    (1 << 3)
-#define FDISK_DEBUG_GEOMETRY    (1 << 4)
-#define FDISK_DEBUG_LABEL       (1 << 5)
-#define FDISK_DEBUG_ALL                0xFFFF
-
-# define ON_DBG(m, x)  do { \
-                               if ((FDISK_DEBUG_ ## m) & fdisk_debug_mask) { \
-                                       x; \
-                               }          \
-                       } while (0)
-
-# define DBG(m, x)     do { \
-                               if ((FDISK_DEBUG_ ## m) & fdisk_debug_mask) { \
-                                       fprintf(stderr, "%d: fdisk: %8s: ", getpid(), # m); \
-                                       x;                              \
-                               } \
-                       } while (0)
-
-# define DBG_FLUSH     do { \
-                               if (fdisk_debug_mask && \
-                                   fdisk_debug_mask != FDISK_DEBUG_INIT) \
-                                       fflush(stderr);                 \
-                       } while(0)
-
-static inline void __attribute__ ((__format__ (__printf__, 1, 2)))
-dbgprint(const char *mesg, ...)
-{
-       va_list ap;
-       va_start(ap, mesg);
-       vfprintf(stderr, mesg, ap);
-       va_end(ap);
-       fputc('\n', stderr);
-}
-
-extern int fdisk_debug_mask;
-extern void fdisk_init_debug(int mask);
-
 struct partition {
        unsigned char boot_ind;         /* 0x80 - active */
        unsigned char head;             /* starting head */