X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=progs%2Ftset.c;h=0ba522cbc4c6eed57bf8f9fa4010894f8d54980e;hb=410952f85a313e9ddb6a1d5939dec1b89c8a40f9;hp=62611b3d40dbfed89695232105a0a1e461b9a46f;hpb=f9994a48d2f74b613a0adb19d3917f724d4d1312;p=ncurses.git diff --git a/progs/tset.c b/progs/tset.c index 62611b3d..0ba522cb 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -91,14 +91,14 @@ #include #include -#if HAVE_GETTTYNAM && HAVE_TTYENT_H +#if HAVE_GETTTYNAM #include #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; @@ -545,12 +545,14 @@ get_termcap_entry(int fd, char *userarg) 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; @@ -563,6 +565,7 @@ get_termcap_entry(int fd, char *userarg) if ((ttype = getenv("TERM")) != 0) goto map; +#if HAVE_PATH_TTYS if ((ttypath = ttyname(fd)) != 0) { p = _nc_basename(ttypath); #if HAVE_GETTTYNAM @@ -600,6 +603,7 @@ get_termcap_entry(int fd, char *userarg) } #endif /* HAVE_GETTTYNAM */ } +#endif /* HAVE_PATH_TTYS */ /* If still undefined, use "unknown". */ ttype = "unknown";