fdisk: don't use get_linux_version() for non-linux
The get_linux_version() function is Linux-specific. Work around it in a few places. [kzak@redhat.com: split the original patch to small patches] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
ff035f67ed
commit
ca04a95a3b
|
@ -3,7 +3,11 @@ include $(top_srcdir)/config/include-Makefile.am
|
||||||
EXTRA_DIST = README.fdisk README.cfdisk sfdisk.examples partitiontype.c
|
EXTRA_DIST = README.fdisk README.cfdisk sfdisk.examples partitiontype.c
|
||||||
|
|
||||||
fdisk_common = i386_sys_types.c common.h gpt.c gpt.h \
|
fdisk_common = i386_sys_types.c common.h gpt.c gpt.h \
|
||||||
../lib/blkdev.c ../lib/linux_version.c
|
../lib/blkdev.c
|
||||||
|
|
||||||
|
if LINUX
|
||||||
|
fdisk_common += ../lib/linux_version.c
|
||||||
|
endif
|
||||||
|
|
||||||
if !ARCH_M68K
|
if !ARCH_M68K
|
||||||
|
|
||||||
|
|
|
@ -1508,7 +1508,10 @@ msdos_partition(char *dev, int fd, unsigned long start, struct disk_desc *z) {
|
||||||
struct sector *s;
|
struct sector *s;
|
||||||
struct part_desc *partitions = &(z->partitions[0]);
|
struct part_desc *partitions = &(z->partitions[0]);
|
||||||
int pno = z->partno;
|
int pno = z->partno;
|
||||||
int bsd_later = (get_linux_version() >= KERNEL_VERSION(2,3,40));
|
int bsd_later = 1;
|
||||||
|
#ifdef __linux__
|
||||||
|
bsd_later = (get_linux_version() >= KERNEL_VERSION(2,3,40));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(s = get_sector(dev, fd, start)))
|
if (!(s = get_sector(dev, fd, start)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -2,8 +2,12 @@ include $(top_srcdir)/config/include-Makefile.am
|
||||||
|
|
||||||
noinst_PROGRAMS = test_blkdev
|
noinst_PROGRAMS = test_blkdev
|
||||||
|
|
||||||
test_blkdev_SOURCES = $(top_srcdir)/lib/blkdev.c \
|
test_blkdev_SOURCES = $(top_srcdir)/lib/blkdev.c
|
||||||
$(top_srcdir)/lib/linux_version.c
|
|
||||||
|
if LINUX
|
||||||
|
test_blkdev_SOURCES += $(top_srcdir)/lib/linux_version.c
|
||||||
|
endif
|
||||||
|
|
||||||
test_blkdev_CFLAGS = -DMAIN_TEST_BLKDEV
|
test_blkdev_CFLAGS = -DMAIN_TEST_BLKDEV
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue