--- origsrc/mc-4.8.23/src/subshell/common.c 2019-06-16 13:49:31.000000000 -0400 +++ src/mc-4.8.23/src/subshell/common.c 2019-12-22 20:44:43.781884100 -0500 @@ -1071,10 +1071,10 @@ init_subshell (void) return; } - /* Opening the FIFO as O_RDONLY or O_WRONLY causes deadlock */ + /* Open the FIFO first as O_RDWR to avoid deadlock */ if ((subshell_pipe[READ] = open (tcsh_fifo, O_RDWR)) == -1 - || (subshell_pipe[WRITE] = open (tcsh_fifo, O_RDWR)) == -1) + || (subshell_pipe[WRITE] = open (tcsh_fifo, O_WRONLY)) == -1) { fprintf (stderr, _("Cannot open named pipe %s\n"), tcsh_fifo); perror (__FILE__ ": open");