diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2007-11-28 10:40:32 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2007-11-28 10:41:26 +0100 |
commit | e460a5bf893227ccd7cdc9b8e5beec1ebc30a858 (patch) | |
tree | 0a3e4f29b76835d95a4d890efd935b6a1fdb7297 /login-utils | |
parent | 7e5fad475258e0b77857011ebdccdcb045a4cd38 (diff) | |
download | util-linux-old-e460a5bf893227ccd7cdc9b8e5beec1ebc30a858.tar.gz |
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 'login-utils')
-rw-r--r-- | login-utils/checktty.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/login-utils/checktty.c b/login-utils/checktty.c index 16f9f2e8..c28ee833 100644 --- a/login-utils/checktty.c +++ b/login-utils/checktty.c @@ -25,12 +25,18 @@ #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; @@ -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; } |