From: François Revol Date: Mon, 26 Jul 2010 09:43:51 +0000 (+0200) Subject: portability: fix mntent.h and pty.h usage X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9779651e2b6c06159a583d5852f1a54c000c6c8e;p=util-linux portability: fix mntent.h and pty.h usage Signed-off-by: François Revol Signed-off-by: Karel Zak --- 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) {