Skip to content

Commit

Permalink
erts: Fix termcap support on solaris
Browse files Browse the repository at this point in the history
fix #8025
  • Loading branch information
garazdawi committed Jan 31, 2024
1 parent b4bd697 commit 168eca3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions erts/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ AS_IF([test "x$with_termcap" != "xno" && test "X$host" != "Xwin32"],
])

AC_SUBST(TERMCAP_LIB)
AC_CHECK_HEADERS([termcap.h curses.h term.h])

if test "x$TERMCAP_LIB" != "x"; then

Expand Down
10 changes: 9 additions & 1 deletion erts/emulator/nifs/common/prim_tty_nif.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@
#include <stdio.h>
#include <signal.h>
#include <locale.h>
#ifdef HAVE_TERMCAP
#if defined(HAVE_TERMCAP) && (defined(HAVE_TERMCAP_H) || (defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)))
#include <termios.h>
#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#else /* !HAVE_TERMCAP_H */
#include <curses.h>
#include <term.h>
#endif
#else
/* We detected TERMCAP support, but could not find the correct headers to include */
#undef HAVE_TERMCAP
#endif
#ifndef __WIN32__
#include <unistd.h>
Expand Down

0 comments on commit 168eca3

Please sign in to comment.