Skip to content

Commit

Permalink
check for tcgetpgrp() presence before using.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero authored and cmatsuoka committed Jan 17, 2017
1 parent 634babc commit c12d5be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,6 @@ XMP_TRY_COMPILE(whether compiler understands -Wunused-result,
int main(){}],
CFLAGS="${CFLAGS} -Wno-unused-result")

AC_CHECK_FUNCS(kill getopt_long)
AC_CHECK_FUNCS(kill getopt_long tcgetpgrp)
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void sigtstp_handler(int n)

static void sigcont_handler(int sig)
{
#ifdef HAVE_TERMIOS_H
#if defined(HAVE_TERMIOS_H) && defined(HAVE_TCGETPGRP)
unsigned int old_in = foreground_in;

foreground_in = tcgetpgrp(STDIN_FILENO) == getpgrp();
Expand Down

0 comments on commit c12d5be

Please sign in to comment.