• Paul Eggert's avatar
    Fix emacsclient hang when backgrounded · 2f985977
    Paul Eggert authored
    Problem reported by Kaushal Modi in:
    The tcdrain call replaced an fdatasync call which had no
    effect on the tty, so removing it entirely shouldn’t cause
    problems.  The fdatasync call replaced an fsync call which
    also had no effect on the tty, and the fsync call seems to be
    badly-merged revenant of emacsclient’s old (circa 2004) way of
    communicating to and from Emacs via FILE * streams, where
    fsync was apparently needed when talking to sockets.
    * lib-src/emacsclient.c [!DOS_NT]: Don’t include termios.h.
    (flush_stdout): Remove.  All callers removed.
    (main): Do not drain the tty after "Waiting for Emacs..."
    message.  There should be no need to drain, and draining it
    might send us a SIGTTOU.  Do not fflush stdout just before
    exiting, as exiting does that for us.
emacsclient.c 53.2 KB