From 9779651e2b6c06159a583d5852f1a54c000c6c8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 26 Jul 2010 11:43:51 +0200 Subject: [PATCH] portability: fix mntent.h and pty.h usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: François Revol Signed-off-by: Karel Zak --- lib/ismounted.c | 6 ++++++ misc-utils/script.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ismounted.c b/lib/ismounted.c index fa7e8225..592df308 100644 --- a/lib/ismounted.c +++ b/lib/ismounted.c @@ -11,11 +11,17 @@ #include #include #include +#if HAVE_MNTENT_H #include +#endif #include #include #include #include +#ifdef __APPLE__ +#include +#include +#endif #include "pathnames.h" #include "ismounted.h" diff --git a/misc-utils/script.c b/misc-utils/script.c index 2028db66..9367fafb 100644 --- a/misc-utils/script.c +++ b/misc-utils/script.c @@ -59,7 +59,7 @@ #include "nls.h" -#ifdef HAVE_LIBUTIL +#if HAVE_LIBUTIL && HAVE_PTY_H #include #endif @@ -91,7 +91,7 @@ struct termios tt; struct winsize win; int lb; int l; -#ifndef HAVE_LIBUTIL +#if !HAVE_LIBUTIL || !HAVE_PTY_H char line[] = "/dev/ptyXX"; #endif int aflg = 0; @@ -467,7 +467,7 @@ done() { void getmaster() { -#ifdef HAVE_LIBUTIL +#if HAVE_LIBUTIL && HAVE_PTY_H (void) tcgetattr(0, &tt); (void) ioctl(0, TIOCGWINSZ, (char *)&win); if (openpty(&master, &slave, NULL, &tt, &win) < 0) { -- 2.39.5