mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
(feed_subshell): on IBM i, read(1) can return 0 for a non-closed fd.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
79e5cdad2f
commit
4da6ea8db3
@ -321,6 +321,11 @@ case $host_os in
|
|||||||
;;
|
;;
|
||||||
esac
|
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*)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user