Ticket #3927: mc_common.c.patch

File mc_common.c.patch, 1.2 KB (added by jax, 6 months ago)

Patch regarding openpty()

  • src/subshell/common.c

    a b  
    8888#include "subshell.h" 
    8989#include "internal.h" 
    9090 
     91#ifdef HAVE_OPENPTY 
     92#include <pty.h> 
     93#endif 
     94 
    9195/*** global variables ****************************************************************************/ 
    9296 
    9397/* State of the subshell: 
     
    10211025 
    10221026        /* FIXME: We may need to open a fresh pty each time on SVR4 */ 
    10231027 
     1028#ifdef HAVE_OPENPTY //TODO: clean this up. Should have a check for HAVE_OPENPTY or something 
     1029        if (openpty(&mc_global.tty.subshell_pty, &subshell_pty_slave, NULL, NULL, NULL)) 
     1030        { 
     1031            fprintf (stderr, "Cannot open master and slave sides of pty: %s\n", unix_error_string (errno)); 
     1032            mc_global.tty.use_subshell = FALSE; 
     1033            return; 
     1034        } 
     1035#else 
     1036         
    10241037        mc_global.tty.subshell_pty = pty_open_master (pty_name); 
    10251038        if (mc_global.tty.subshell_pty == -1) 
    10261039        { 
     
    10361049            mc_global.tty.use_subshell = FALSE; 
    10371050            return; 
    10381051        } 
    1039  
     1052#endif /* #ifdef PASE */ 
    10401053        /* Create a pipe for receiving the subshell's CWD */ 
    10411054 
    10421055        if (mc_global.shell->type == SHELL_TCSH)