Ticket #1637: 0001-don-t-set-TOSTOP-attribute-on-slave-terminal.patch

File 0001-don-t-set-TOSTOP-attribute-on-slave-terminal.patch, 1.3 KB (added by slavazanko, 10 years ago)
  • src/subshell.c

    From bf9a5a1d0bcdc2542148687afd526053c7d5fd69 Mon Sep 17 00:00:00 2001
    From: Aliaksey Kandratsenka <alk@tut.by>
    Date: Thu, 24 Sep 2009 14:20:40 +0300
    Subject: [PATCH] don't set TOSTOP attribute on slave terminal
    
    TOSTOP doesn't work well with some software. Examples known to me are:
    - debugging multithreaded program with gdb (gdb job stops)
    - running 'check' tests in fork mode (default) that do some output
    (tests mysteriously fail due to timeout)
    
    IMO TOSTOP adds too little value compared to compatibility problems it
    creates.
    ---
     src/subshell.c |    5 +----
     1 files changed, 1 insertions(+), 4 deletions(-)
    
    diff --git a/src/subshell.c b/src/subshell.c
    index 120bd99..05d6ab1 100644
    a b init_subshell_child (const char *pty_name) 
    214214 
    215215    /* Configure its terminal modes and window size */ 
    216216 
    217     /* Set up the pty with the same termios flags as our own tty, plus  */ 
    218     /* TOSTOP, which keeps background processes from writing to the pty */ 
    219  
    220     shell_mode.c_lflag |= TOSTOP;       /* So background writers get SIGTTOU */ 
     217    /* Set up the pty with the same termios flags as our own tty */ 
    221218    if (tcsetattr (subshell_pty_slave, TCSANOW, &shell_mode)) { 
    222219        fprintf (stderr, "Cannot set pty terminal modes: %s\r\n", 
    223220                 unix_error_string (errno));