#include <transform.h>
#include <tty_settings.h>
-#if HAVE_GETTTYNAM && HAVE_TTYENT_H
+#if HAVE_GETTTYNAM
#include <ttyent.h>
#endif
#ifdef NeXT
char *ttyname(int fd);
#endif
-MODULE_ID("$Id: tset.c,v 1.130 2021/10/02 18:08:09 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.131 2021/12/04 23:02:13 tom Exp $")
#ifndef environ
extern char **environ;
int errret;
char *p;
const char *ttype;
+#if HAVE_PATH_TTYS
#if HAVE_GETTTYNAM
struct ttyent *t;
#else
FILE *fp;
#endif
char *ttypath;
+#endif /* HAVE_PATH_TTYS */
(void) fd;
if ((ttype = getenv("TERM")) != 0)
goto map;
+#if HAVE_PATH_TTYS
if ((ttypath = ttyname(fd)) != 0) {
p = _nc_basename(ttypath);
#if HAVE_GETTTYNAM
}
#endif /* HAVE_GETTTYNAM */
}
+#endif /* HAVE_PATH_TTYS */
/* If still undefined, use "unknown". */
ttype = "unknown";