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>
AC_SYS_LARGEFILE
-AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h], [], [], [
+AC_CHECK_HEADERS([linux/compiler.h linux/blkpg.h linux/major.h], [], [], [
#ifdef HAVE_LINUX_COMPILER_H
#include <linux/compiler.h>
#endif
#include <endian.h>
#include "nls.h"
-#include <linux/major.h> /* FLOPPY_MAJOR */
#include "blkdev.h"
#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"
#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
#include "nls.h"
#include <sys/sysmacros.h>
+#ifdef HAVE_LINUX_MAJOR_H
#include <linux/major.h>
+#endif
#include "pathnames.h"
#include "login.h"
#include "xstrncpy.h"
+#ifndef TTY_MAJOR
+#define TTY_MAJOR 4
+#endif
+
static gid_t mygroups[NGROUPS];
static int num_groups;
static int
isapty(const char *tty)
{
+#ifdef __linux__
char devname[100];
struct stat stb;
#endif
}
+#endif /* __linux__ */
return 0;
}