]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: check HAVE_ definitions with #ifdef [smatch scan]
authorSami Kerola <kerolasa@iki.fi>
Thu, 1 Dec 2011 22:10:21 +0000 (23:10 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 2 Dec 2011 17:27:12 +0000 (18:27 +0100)
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 <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/script.c

index 9e08ff62a6e20e108650f6264f23f29cf240f6c0..58f9790addc4df47e7223cefc64a2babc2884cfb 100644 (file)
 #include "nls.h"
 #include "c.h"
 
-#ifdef HAVE_LIBUTIL
-# ifdef HAVE_PTY_H
-#  include <pty.h>
-# endif
+#if defined(HAVE_LIBUTIL) && defined(HAVE_PTY_H)
+# include <pty.h>
 #endif
 
 #ifdef HAVE_LIBUTEMPTER
-#include <utempter.h>
+# include <utempter.h>
 #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;