From: Sami Kerola Date: Thu, 1 Dec 2011 22:10:21 +0000 (+0100) Subject: build-sys: check HAVE_ definitions with #ifdef [smatch scan] X-Git-Tag: v2.21-rc1~141 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e11a5e6375441d2734402b68066e5f16b3c22f2a;p=thirdparty%2Futil-linux.git build-sys: check HAVE_ definitions with #ifdef [smatch scan] Fix to `warning: undefined preprocessor identifier' messages. [kzak@redhat.com: replace "#ifdef XXX #ifdef YYY" with "#if defined(XXX) && defined(YYY)"] Signed-off-by: Sami Kerola Signed-off-by: Karel Zak --- diff --git a/term-utils/script.c b/term-utils/script.c index 9e08ff62a6..58f9790add 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -62,14 +62,12 @@ #include "nls.h" #include "c.h" -#ifdef HAVE_LIBUTIL -# ifdef HAVE_PTY_H -# include -# endif +#if defined(HAVE_LIBUTIL) && defined(HAVE_PTY_H) +# include #endif #ifdef HAVE_LIBUTEMPTER -#include +# include #endif #define DEFAULT_OUTPUT "typescript" @@ -501,15 +499,13 @@ done(void) { void getmaster(void) { -#ifdef HAVE_LIBUTIL -# ifdef HAVE_PTY_H +#if defined(HAVE_LIBUTIL) && defined(HAVE_PTY_H) tcgetattr(STDIN_FILENO, &tt); ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&win); if (openpty(&master, &slave, NULL, &tt, &win) < 0) { warn(_("openpty failed")); fail(); } -# endif #else char *pty, *bank, *cp; struct stat stb;