1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00
emacs/lib-src
Paul Eggert 0331f2f4c5 emacsclient: fix some races on POSIX systems
Fix some longstanding race conditions due to emacsclient’s use of
‘signal’ instead of ‘sigaction’ and its use of nested signal
handlers.  These races could cause premature exit or incorrect
commands sent to Emacs.
* lib-src/emacsclient.c (signal) [!WINDOWSNT]: Do not undef.
(emacs_socket): Remove this static variable.  It is now a parameter.
(send_to_emacs): Do not exit merely because ‘send’ was interrupted.
Instead, act on the signal if possible, and then retry the ‘send’.
(pass_signal_to_emacs): Remove; now done by act_on_signals.
(reinstall_handler_if_needed, handle_sigttou, handle_sigwinch)
(install_handler): New functions.
(got_sigcont, got_sigtstp, got_sigttou, got_sigwinch):
New globals, used for more-portable signal handling.
(handle_sigcont, handle_sigtstp): Just set the static var; other
actions are now done later by act_on_signals.
(install_handler): New function that arranges for signals to
never be reset to default, on modern POSIX platforms.
This fixes some races.
(act_on_signals): New function.  When acting on SIGCONT,
don’t bother calling getpgrp if tcgetpgrp fails.
(start_daemon_and_retry_set_socket): Return the socket
rather than setting a global variable.  All uses changed.
(flush_stdout): New function that acts on signals received while
flushing.
(main): Use it.  emacs_socket is now a local var.
Act on signals received during recv.
2018-11-26 11:39:44 -08:00
..
ChangeLog.1 Update copyright year to 2018 2018-01-01 00:57:59 -08:00
COPYING Merge from Gnulib 2017-10-01 18:31:10 -07:00
ctags.c Port ctags+etags build to Sun C 5.12. 2014-05-18 11:57:04 -07:00
ebrowse.c Port --enable-gcc-warnings to GCC 8 2018-04-28 16:56:48 -07:00
emacsclient.c emacsclient: fix some races on POSIX systems 2018-11-26 11:39:44 -08:00
etags.c Make mini-gmp safe for --enable-gcc-warnings 2018-08-12 11:13:15 -07:00
hexl.c Update copyright year to 2018 2018-01-01 00:57:59 -08:00
make-docfile.c Port --enable-gcc-warnings to GCC 8 2018-04-28 16:56:48 -07:00
Makefile.in Fix ‘make clean’ with a file named ‘-.o’ 2018-09-24 10:45:07 -07:00
movemail.c Port --enable-gcc-warnings to GCC 8 2018-04-28 16:56:48 -07:00
ntlib.c Fix the MS-Windows build as followup to Gnulib regex import 2018-08-06 17:50:55 +03:00
ntlib.h Update copyright year to 2018 2018-01-01 00:57:59 -08:00
pop.c ; Fix last change: only MinGW runtime 5.0.2 and later needs that. 2018-07-28 17:21:53 +03:00
pop.h Update copyright year to 2018 2018-01-01 00:57:59 -08:00
profile.c Move current_timespec decl to timespec.h 2018-09-16 21:28:08 -07:00
rcs2log Fix copyright years by hand 2018-01-01 01:02:09 -08:00
README
update-game-score.c Update copyright year to 2018 2018-01-01 00:57:59 -08:00

This directory contains the source code for the architecture-dependent
files that go in ${archlibdir}.  At present, these are mostly utility
programs used by GNU Emacs.