summaryrefslogtreecommitdiffstats
path: root/fdisk/fdisksunlabel.c
diff options
context:
space:
mode:
authorSamuel Thibault2007-11-28 10:40:32 +0100
committerKarel Zak2007-11-28 10:41:26 +0100
commite460a5bf893227ccd7cdc9b8e5beec1ebc30a858 (patch)
tree0a3e4f29b76835d95a4d890efd935b6a1fdb7297 /fdisk/fdisksunlabel.c
parentfdisk: non-linux support (MAXPATHLEN) (diff)
downloadkernel-qcow2-util-linux-e460a5bf893227ccd7cdc9b8e5beec1ebc30a858.tar.gz
kernel-qcow2-util-linux-e460a5bf893227ccd7cdc9b8e5beec1ebc30a858.tar.xz
kernel-qcow2-util-linux-e460a5bf893227ccd7cdc9b8e5beec1ebc30a858.zip
build-sys: cleanup usage of linux/major.h
The utils like fdisk or login are usable on non-linux systems. This patch allows to compile on systems without linux/major.h. Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'fdisk/fdisksunlabel.c')
-rw-r--r--fdisk/fdisksunlabel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fdisk/fdisksunlabel.c b/fdisk/fdisksunlabel.c
index ff9a182db..4ed973305 100644
--- a/fdisk/fdisksunlabel.c
+++ b/fdisk/fdisksunlabel.c
@@ -27,7 +27,9 @@
#include <scsi/scsi.h> /* SCSI_IOCTL_GET_IDLUN */
#undef u_char
#endif
+#ifdef HAVE_LINUX_MAJOR_H
#include <linux/major.h> /* FLOPPY_MAJOR */
+#endif
#include "common.h"
#include "fdisk.h"
@@ -69,6 +71,9 @@ static inline __u32 __swap32(__u32 x) {
#define SSWAP32(x) (other_endian ? __swap32(x) \
: (__u32)(x))
+#ifndef FLOPPY_MAJOR
+#define FLOPPY_MAJOR 2
+#endif
#ifndef IDE0_MAJOR
#define IDE0_MAJOR 3
#endif