Merge branch '3927_ibm_i'

* 3927_ibm_i:
  (feed_subshell): on IBM i, read(1) can return 0 for a non-closed fd.
  configure.ac: check of Perl, Pyhton and Ruby on IBM i.
  Ticket #3927: fix compilation failure on IBM i.
This commit is contained in:
Andrew Borodin 2018-09-09 18:59:09 +03:00
commit 3f8290e27e
2 changed files with 34 additions and 7 deletions

View File

@ -57,9 +57,7 @@ dnl ############################################################################
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PATH_PROG([PERL], [perl], [/usr/bin/perl]) dnl See also the "OS specific stuff" section below.
AC_PATH_PROG([PYTHON], [python], [/usr/bin/python])
AC_PATH_PROG([RUBY], [ruby], [/usr/bin/ruby])
dnl Check nroff and the options it supports dnl Check nroff and the options it supports
AC_CHECK_PROG(HAVE_nroff, nroff, true, false) AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
@ -233,9 +231,6 @@ AC_CHECK_FUNCS([\
realpath realpath
]) ])
dnl utimensat is supported since glibc 2.6 and specified in POSIX.1-2008
AC_CHECK_FUNCS([utimensat])
dnl getpt is a GNU Extension (glibc 2.1.x) dnl getpt is a GNU Extension (glibc 2.1.x)
AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)]) AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)]) AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
@ -277,9 +272,21 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
mc_I18N mc_I18N
dnl ############################################################################ dnl ############################################################################
dnl OS specific flags dnl OS specific stuff
dnl ############################################################################ dnl ############################################################################
case $host_os in
*os400)
AC_PATH_PROG([PERL], [perl], [/QOpenSys/pkgs/bin/perl])
AC_PATH_PROG([PYTHON], [python], [/QOpenSys/pkgs/bin/python2])
AC_PATH_PROG([RUBY], [ruby], [/QOpenSys/pkgs/bin/ruby])
;;
*)
AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
AC_PATH_PROG([PYTHON], [python], [/usr/bin/python])
AC_PATH_PROG([RUBY], [ruby], [/usr/bin/ruby])
esac
case $host_os in case $host_os in
aux*) aux*)
# A/UX # A/UX
@ -304,6 +311,21 @@ AC_EGREP_CPP([yes],
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
]) ])
dnl utimensat is supported since glibc 2.6 and specified in POSIX.1-2008
dnl utimensat() causes different timespec structures to cause failures on IBM i
case $host_os in
*os400)
;;
*)
AC_CHECK_FUNCS([utimensat])
;;
esac
case $host_os in
*os400)
AC_DEFINE([PTY_ZEROREAD], [1], [read(1) can return 0 for a non-closed fd])
esac
dnl Check linux/fs.h for FICLONE to support BTRFS's file clone operation dnl Check linux/fs.h for FICLONE to support BTRFS's file clone operation
case $host_os in case $host_os in
linux*) linux*)

View File

@ -558,9 +558,14 @@ feed_subshell (int how, gboolean fail_on_error)
if (bytes <= 0) if (bytes <= 0)
{ {
#ifdef PTY_ZEROREAD
/* On IBM i, read(1) can return 0 for a non-closed fd */
continue;
#else
tcsetattr (STDOUT_FILENO, TCSANOW, &shell_mode); tcsetattr (STDOUT_FILENO, TCSANOW, &shell_mode);
fprintf (stderr, "read (subshell_pty...): %s\r\n", unix_error_string (errno)); fprintf (stderr, "read (subshell_pty...): %s\r\n", unix_error_string (errno));
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
#endif
} }
if (how == VISIBLY) if (how == VISIBLY)