emacsclient -t should not suspend Emacs server
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 11 Jan 2013 02:40:58 +0000 (18:40 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 11 Jan 2013 02:40:58 +0000 (18:40 -0800)
commitb895642720aaf1d89e22c7cdda11990919622a72
tree319a9a095ad702cbb7c93eb0a127444fd7874805
parenta778dd57d0da9004a72320f8082d4f6220f178e2
emacsclient -t should not suspend Emacs server

* lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
New functions.
* term.c (init_tty): Use them instead of rolling our own code.
* sysdep.c (tcsetpgrp_without_stopping): Likewise.  Here, this
switches from 'signal' to 'pthread_sigmask', which is safer in
multithreaded applications.
* term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
which has already arranged for that.
(dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
This is the main part of the bug fix.

Fixes: debbugs:13387
src/ChangeLog
src/lisp.h
src/sysdep.c
src/term.c