summaryrefslogtreecommitdiffstats
path: root/term-utils/script.c
diff options
context:
space:
mode:
authorSami Kerola2011-12-01 23:10:21 +0100
committerKarel Zak2011-12-02 18:27:12 +0100
commite11a5e6375441d2734402b68066e5f16b3c22f2a (patch)
tree0113b2ae1e3edc1bda40422a3b8871bdcdd3203a /term-utils/script.c
parentbuild-sys: check HAVE_ definitions with #ifdef [smatch scan] (diff)
downloadkernel-qcow2-util-linux-e11a5e6375441d2734402b68066e5f16b3c22f2a.tar.gz
kernel-qcow2-util-linux-e11a5e6375441d2734402b68066e5f16b3c22f2a.tar.xz
kernel-qcow2-util-linux-e11a5e6375441d2734402b68066e5f16b3c22f2a.zip
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 <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/script.c')
-rw-r--r--term-utils/script.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/term-utils/script.c b/term-utils/script.c
index 9e08ff62a..58f9790ad 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 <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;