From e460a5bf893227ccd7cdc9b8e5beec1ebc30a858 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 28 Nov 2007 10:40:32 +0100 Subject: 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 Signed-off-by: Samuel Thibault --- login-utils/checktty.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'login-utils') diff --git a/login-utils/checktty.c b/login-utils/checktty.c index 16f9f2e88..c28ee833d 100644 --- a/login-utils/checktty.c +++ b/login-utils/checktty.c @@ -25,12 +25,18 @@ #include "nls.h" #include +#ifdef HAVE_LINUX_MAJOR_H #include +#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; @@ -118,6 +124,7 @@ add_to_class(struct ttyclass *tc, char *tty) static int isapty(const char *tty) { +#ifdef __linux__ char devname[100]; struct stat stb; @@ -147,6 +154,7 @@ isapty(const char *tty) #endif } +#endif /* __linux__ */ return 0; } -- cgit v1.2.3-55-g7522