diff --git a/configure.ac b/configure.ac index a0c88fb0e..cdf5a8b6c 100644 --- a/configure.ac +++ b/configure.ac @@ -57,9 +57,7 @@ dnl ############################################################################ PKG_PROG_PKG_CONFIG AC_PROG_INSTALL AC_PROG_LN_S -AC_PATH_PROG([PERL], [perl], [/usr/bin/perl]) -AC_PATH_PROG([PYTHON], [python], [/usr/bin/python]) -AC_PATH_PROG([RUBY], [ruby], [/usr/bin/ruby]) +dnl See also the "OS specific stuff" section below. dnl Check nroff and the options it supports AC_CHECK_PROG(HAVE_nroff, nroff, true, false) @@ -233,9 +231,6 @@ AC_CHECK_FUNCS([\ 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) AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)]) AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)]) @@ -277,9 +272,21 @@ AM_GNU_GETTEXT_VERSION([0.18.1]) mc_I18N dnl ############################################################################ -dnl OS specific flags +dnl OS specific stuff 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 aux*) # A/UX @@ -304,6 +311,21 @@ AC_EGREP_CPP([yes], 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 case $host_os in linux*) diff --git a/src/subshell/common.c b/src/subshell/common.c index eca94311e..505fbe325 100644 --- a/src/subshell/common.c +++ b/src/subshell/common.c @@ -558,9 +558,14 @@ feed_subshell (int how, gboolean fail_on_error) 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); fprintf (stderr, "read (subshell_pty...): %s\r\n", unix_error_string (errno)); exit (EXIT_FAILURE); +#endif } if (how == VISIBLY)