diff --git a/Makefile.inc b/Makefile.inc index 7fe63ea..62b1b83 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -25,7 +25,7 @@ DEBUG=yes CFLAGS := $(if $(DEBUG),-g -O0 -DDEBUG,-O2) $(CFLAGS) CFLAGS += -I. -I../include -fno-strict-aliasing \ - -Wall -Wstrict-prototypes -Werror -Wformat-security \ + -Wall -Wstrict-prototypes -Wno-error -Wformat-security \ -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 CFLAGS += $(RPM_OPT_FLAGS) $(CPPFLAGS) CFLAGS += $(if $(PLOOP_LOG_FILE), -DPLOOP_LOG_FILE=\"$(PLOOP_LOG_FILE)\") diff --git a/lib/balloon_util.c b/lib/balloon_util.c index be5d0af..dd96690 100644 --- a/lib/balloon_util.c +++ b/lib/balloon_util.c @@ -33,6 +33,8 @@ #include "ploop.h" +#define offsetof(type, field) __builtin_offsetof(type, field) + #define MIN(a, b) (a < b ? a : b) static void range_fix_gaps(struct freemap *freemap, __u32 iblk_start, __u32 iblk_end, diff --git a/lib/delta_read.c b/lib/delta_read.c index 11ada91..8ebfb67 100644 --- a/lib/delta_read.c +++ b/lib/delta_read.c @@ -27,6 +27,8 @@ #include "ploop.h" +#define offsetof(type, field) __builtin_offsetof(type, field) + void init_delta_array(struct delta_array * p) { p->delta_max = 0; diff --git a/lib/delta_sysfs.c b/lib/delta_sysfs.c index 3c16e44..98e7254 100644 --- a/lib/delta_sysfs.c +++ b/lib/delta_sysfs.c @@ -238,7 +238,7 @@ static int get_dev_num(const char *path, dev_t *dev_num) ploop_err(0, "Unexpected format of %s: %s", path, nbuf); return -1; } - *dev_num = gnu_dev_makedev(maj, min); + *dev_num = makedev(maj, min); return 0; } diff --git a/lib/merge.c b/lib/merge.c index ef120b8..8d7bea0 100644 --- a/lib/merge.c +++ b/lib/merge.c @@ -32,6 +32,8 @@ #include "ploop.h" +#define offsetof(type, field) __builtin_offsetof(type, field) + static int sync_cache(struct delta * delta) { int skip = 0; diff --git a/lib/ploop.c b/lib/ploop.c index ed30cf0..6d7370e 100644 --- a/lib/ploop.c +++ b/lib/ploop.c @@ -1087,7 +1087,7 @@ static int get_mount_dir(const char *device, char *out, int size) if (get_dev_by_name(device, &dev)) return -1; - minor = gnu_dev_minor(dev); + minor = minor(dev); fp = fopen("/proc/self/mountinfo", "r"); if (fp == NULL) { @@ -1719,7 +1719,7 @@ static int create_ploop_dev(int minor) make_sysfs_dev_name(minor, device + 5, sizeof(device) - 5); /* Create pair /dev/ploopN & /dev/ploopNp1 */ if (access(device, F_OK)) { - if (mknod(device, S_IFBLK, gnu_dev_makedev(PLOOP_DEV_MAJOR, minor))) { + if (mknod(device, S_IFBLK, makedev(PLOOP_DEV_MAJOR, minor))) { ploop_err(errno, "mknod %s", device); return SYSEXIT_MKNOD; } @@ -1730,7 +1730,7 @@ static int create_ploop_dev(int minor) } snprintf(devicep1, sizeof(devicep1), "%sp1", device); if (access(devicep1, F_OK)) { - if (mknod(devicep1, S_IFBLK, gnu_dev_makedev(PLOOP_DEV_MAJOR, minor+1))) { + if (mknod(devicep1, S_IFBLK, makedev(PLOOP_DEV_MAJOR, minor+1))) { ploop_err(errno, "mknod %s", devicep1); return SYSEXIT_MKNOD; }