summaryrefslogtreecommitdiff
path: root/src/w32reg.c
Commit message (Collapse)AuthorAgeFilesLines
* Simplify and avoid signal-handling races.Paul Eggert2012-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nt/inc/ms-w32.h (emacs_raise): New macro. * src/alloc.c (die): * src/sysdep.c (emacs_abort) [HAVE_NTGUI]: Avoid recursive loop if there's a fatal error in the function itself. * src/atimer.c (pending_atimers): * src/blockinput.h: Don't include "atimer.h"; no longer needed. (interrupt_input_pending): Remove. All uses removed. pending_signals now counts both atimers and ordinary interrupts. This is less racy than having three separate pending-signal flags. (block_input, unblock_input, totally_unblock_input, unblock_input_to) (input_blocked_p): Rename from their upper-case counterparts BLOCK_INPUT, UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO, INPUT_BLOCKED_P, and turn into functions. All uses changed. This makes it easier to access volatile variables more accurately. (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input (). (input_blocked_p): Prefer this to 'interrupt_input_blocked', as that's more reliable if the code is buggy and sets interrupt_input_blocked to a negative value. All uses changed. * src/atimer.c (deliver_alarm_signal): Remove. No need to deliver this to the parent; any thread can handle this signal now. All uses replaced by underlying handler. * src/atimer.c (turn_on_atimers): * src/dispnew.c (handle_window_change_signal): * src/emacs.c (handle_danger_signal): * src/keyboard.c (kbd_buffer_get_event): Don't reestablish signal handler; not needed with sigaction. * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT) (UNBLOCK_INPUT_TO): Rework to avoid unnecessary accesses to volatile variables. (UNBLOCK_INPUT_TO): Now a function. (totally_unblock_input, unblock_input): New decls. * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c (init_data): Remove. Necessary stuff now done in init_signal. * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions. * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c. (fatal_error_code): Remove; no longer needed. (terminate_due_to_signal): Rename from fatal_error_backtrace, since it doesn't always backtrace. All uses changed. No need to reset signal to default, since sigaction and/or die does that for us now. Use emacs_raise (FOO), not kill (getpid (), FOO). (main): Check more-accurately whether we're dumping. Move fatal-error setup to sysdep.c * src/floatfns.c: Do not include "syssignal.h"; no longer needed. * src/gtkutil.c (xg_get_file_name, xg_get_font): Remove no-longer-needed signal-mask manipulation. * src/keyboard.c, src/process.c (POLL_FOR_INPUT): Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined. * src/keyboard.c (read_avail_input): Remove. All uses replaced by gobble_input. (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code. (kbd_buffer_store_event_hold, gobble_input): (record_asynch_buffer_change) [USABLE_SIGIO]: (store_user_signal_events): No need to mess with signal mask. (gobble_input): If blocking input and there are terminals, simply set pending_signals to 1 and return. All hooks changed to not worry about whether input is blocked. (process_pending_signals): Clear pending_signals before processing them, in case a signal comes in while we're processing. By convention callers now test pending_signals before calling us. (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input): New functions, to support changes to blockinput.h. (handle_input_available_signal): Now extern. (reinvoke_input_signal): Remove. All uses replaced by handle_async_input. (quit_count): Now volatile, since a signal handler uses it. (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All callers changed. Block SIGINT only if not already blocked. Clear sigmask reliably, even if Fsignal returns, which it can. Omit unnecessary accesses to volatile var. (quit_throw_to_read_char): No need to restore sigmask. * src/keyboard.c (gobble_input, handle_user_signal): * src/process.c (wait_reading_process_output): Call signal-handling code rather than killing ourselves. * src/lisp.h: Include <float.h>, for... (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication. (pending_signals): Now volatile. (syms_of_data): Now const if IEEE floating point. (handle_input_available_signal) [USABLE_SIGIO]: (terminate_due_to_signal, record_child_status_change): New decls. * src/process.c (create_process): Avoid disaster if memory is exhausted while we're processing a vfork, by tightening the critical section around the vfork. (send_process_frame, process_sent_to, handle_pipe_signal) (deliver_pipe_signal): Remove. No longer needed, as Emacs now ignores SIGPIPE. (send_process): No need for setjmp/longjmp any more, since the SIGPIPE stuff is now gone. Instead, report an error if errno is EPIPE. (record_child_status_change): Now extern. PID and W are now args. Return void, not bool. All callers changed. * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]: Remove. All uses removed. This bug should be fixed now in a different way. (wait_for_termination_1): Use waitpid rather than sigsuspend, and record the child status change directly. This avoids the need to futz with the signal mask. (process_fatal_action): Move here from emacs.c. (emacs_sigaction_flags): New function, containing much of what used to be in emacs_sigaction_init. (emacs_sigaction_init): Use it. Block nonfatal system signals that are caught by emacs, to make races less likely. (deliver_process_signal): Rename from handle_on_main_thread. All uses changed. (BACKTRACE_LIMIT_MAX): Now at top level. (thread_backtrace_buffer, threadback_backtrace_pointers): New static vars. (deliver_thread_signal, deliver_fatal_thread_signal): New functions, for more-accurate delivery of thread-specific signals. (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c. (deliver_arith_signal): Handle in this thread, not in the main thread, since it's triggered by this thread. (maybe_fatal_sig): New function. (init_signals): New arg DUMPING so that we can be more accurate about whether we're dumping. Caller changed. Treat thread-specific signals differently from process-general signals. Block all signals while handling fatal error; that's safer. xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal on IEEE hosts. When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored. Ignore SIGPIPE unless batch. (emacs_backtrace): Output backtrace for the appropriate thread, which is not necessarily the main thread. * src/syssignal.h: Include <stdbool.h>. (emacs_raise): New macro. * src/xterm.c (x_connection_signal): Remove; no longer needed now that we use sigaction. (x_connection_closed): No need to mess with sigmask now. (x_initialize): No need to reset SIGPIPE handler here, since init_signals does this for us now. Fixes: debbugs:12471
* Fix MS-Windows build broken by 2012-09-15T07:06:56Z!eggert@cs.ucla.edu, ↵Eli Zaretskii2012-09-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | completing fix for bug #12446. src/w32xfns.c: src/w32uniscribe.c: src/w32term.c: src/w32select.c: src/w32reg.c: src/w32proc.c: src/w32menu.c: src/w32inevt.c: src/w32heap.c: src/w32font.c: src/w32fns.c: src/w32console.c: src/w32.c: src/w16select.c: Remove inclusion of setjmp.h, as it is now included by lisp.h. This completes removal of setjmp.h inclusion erroneously announced in the previous commit. src/lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary more accurate. src/image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is not defined as a macro. The latter happens on MS-Windows.
* Cleanup xmalloc.Dmitry Antipov2012-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/coccinelle/xzalloc.cocci: Semantic patch to convert calls to xmalloc with following memset to xzalloc. * src/lisp.h (xzalloc): New prototype. Omit needless casts. * src/alloc.c (xzalloc): New function. Omit needless casts. * src/charset.c: Omit needless casts. Convert all calls to malloc with following memset to xzalloc. * src/dispnew.c: Likewise. * src/fringe.c: Likewise. * src/image.c: Likewise. * src/sound.c: Likewise. * src/term.c: Likewise. * src/w32fns.c: Likewise. * src/w32font.c: Likewise. * src/w32term.c: Likewise. * src/xfaces.c: Likewise. * src/xfns.c: Likewise. * src/xterm.c: Likewise. * src/atimer.c: Omit needless casts. * src/buffer.c: Likewise. * src/callproc.c: Likewise. * src/ccl.c: Likewise. * src/coding.c: Likewise. * src/composite.c: Likewise. * src/doc.c: Likewise. * src/doprnt.c: Likewise. * src/editfns.c: Likewise. * src/emacs.c: Likewise. * src/eval.c: Likewise. * src/filelock.c: Likewise. * src/fns.c: Likewise. * src/gtkutil.c: Likewise. * src/keyboard.c: Likewise. * src/lisp.h: Likewise. * src/lread.c: Likewise. * src/minibuf.c: Likewise. * src/msdos.c: Likewise. * src/print.c: Likewise. * src/process.c: Likewise. * src/region-cache.c: Likewise. * src/search.c: Likewise. * src/sysdep.c: Likewise. * src/termcap.c: Likewise. * src/terminal.c: Likewise. * src/tparam.c: Likewise. * src/w16select.c: Likewise. * src/w32.c: Likewise. * src/w32reg.c: Likewise. * src/w32select.c: Likewise. * src/w32uniscribe.c: Likewise. * src/widget.c: Likewise. * src/xdisp.c: Likewise. * src/xmenu.c: Likewise. * src/xrdb.c: Likewise. * src/xselect.c: Likewise.
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* src/image.c, src/w32*.c, lib-src/emacsclient.c: Silence warnings under -Wall.Juanma Barranquero2011-10-271-4/+3
|
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-2/+1
|
* Nuke arch-tags.Glenn Morris2011-01-151-2/+0
|
* Merge from emacs-23Stefan Monnier2011-01-141-1/+1
|\
| * Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-021-1/+1
| |
* | Do not include stdlib.h and string.h, config.h does it.Dan Nicolaescu2010-10-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xfont.c: * src/w32term.c: * src/w32reg.c: * src/w32inevt.c: * src/w32heap.c: * src/w32console.c: * src/w16select.c: * src/unexsol.c: * src/term.c: * src/sound.c: * src/scroll.c (m): * src/gtkutil.c: * src/font.c: * src/filelock.c: * src/fileio.c: * src/dosfns.c: * src/dbusbind.c: * src/bidi.c: * src/callproc.c: * src/process.c: * src/msdos.c: * src/charset.c: Do not include stdlib.h and string.h, config.h does it. * configure.in: Include stdlib.h and string.h unconditionally.
* | src/w32*.c: Convert function definitions to standard C.Juanma Barranquero2010-07-061-9/+3
|/
* Add 2010 to copyright years.Glenn Morris2010-01-131-1/+1
|
* * alloc.c: Do not define struct catchtag.Dan Nicolaescu2009-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c: Move struct catchtag definition ... * lisp.h: ... here. * image.c: Move png.h #include earlier to avoid warnings. * xterm.c: * xsmfns.c: * xselect.c: * xrdb.c: * xmenu.c: * xftfont.c: * xfont.c: * xfns.c: * xfaces.c: * xdisp.c: * window.c: * widget.c: * w32xfns.c: * w32uniscribe.c: * w32term.c: * w32select.c: * w32reg.c: * w32proc.c: * w32menu.c: * w32inevt.c: * w32heap.c: * w32font.c: * w32fns.c: * w32console.c: * w32.c: * w16select.c: * vm-limit.c: * unexsol.c: * unexec.c: * unexcw.c: * unexaix.c: * undo.c: * tparam.c: * textprop.c: * terminfo.c: * terminal.c: * termcap.c: * term.c: * syntax.c: * sound.c: * sheap.c: * search.c: * scroll.c: * region-cache.c: * regex.c: * ralloc.c: * process.c: * print.c: * msdos.c: * minibuf.c: * menu.c: * marker.c: * macros.c: * keymap.c: * keyboard.c: * intervals.c: * insdel.c: * indent.c: * gtkutil.c: * ftxfont.c: * ftfont.c: * fringe.c: * frame.c: * fontset.c: * font.c: * fns.c: * floatfns.c: * filelock.c: * fileio.c: * emacs.c: * editfns.c: * dosfns.c: * doprnt.c: * doc.c: * dispnew.c: * dired.c: * dbusbind.c: * data.c: * composite.c: * coding.c: * cmds.c: * cm.c: * chartab.c: * charset.c: * character.c: * ccl.c: * category.c: * casetab.c: * casefiddle.c: * callproc.c: * callint.c: * bytecode.c: * buffer.c: * atimer.c: Include setjmp.h. (Bug#4643) * xlwmenu.c: * lwlib.c: * lwlib-utils.c: * lwlib-Xm.c: * lwlib-Xlw.c: * lwlib-Xaw.c: Include setjmp.h.
* The --quick command line option now ignores X resources and Registry settings.Juanma Barranquero2009-09-171-1/+5
| | | | | | | | | | | | | | | | | * etc/NEWS: Mention new behavior of -Q and new variable `inhibit-x-resources'. * lisp/startup.el (emacs-quick-startup): Remove variable and all uses. (command-line): Set `inhibit-x-resources' instead. (command-line-1): Use `inhibit-x-resources' instead. * src/emacs.c (inhibit_x_resources): New variable. (main) [HAVE_NS]: Don't process --quick command line option. (syms_of_emacs) <inhibit-x-resources>: DEFVAR_BOOL it. * src/lisp.h (inhibit_x_resources): Declare it extern. * src/w32reg.c (x_get_string_resource): * src/xrdb.c (x_get_string_resource): Obey inhibit_x_resources.
* Add 2009 to copyright years.Glenn Morris2009-01-081-1/+1
|
* Switch to recommended form of GPLv3 permissions notice.Glenn Morris2008-05-141-6/+4
|
* Add 2008 to copyright years.Glenn Morris2008-01-081-1/+1
|
* (SYSTEM_DEFAULT_RESOURCES): Add missing NULL terminator.Jason Rumney2007-08-221-1/+1
|
* Switch license to GPLv3 or later.Glenn Morris2007-07-251-1/+1
|
* Update copyright for years from Emacs 21 to present (mainly addingGlenn Morris2007-01-141-2/+2
| | | | 2001).
* Update years in copyright notice; nfc.Thien-Thi Nguyen2006-02-061-1/+1
|
* Update years in copyright notice; nfc.Thien-Thi Nguyen2005-08-071-1/+2
|
* Update FSF's address.Lute Kamstra2005-07-041-2/+2
|
* Add arch taglinesMiles Bader2003-09-011-0/+3
|
* (SYSTEM_DEFAULT_RESOURCES): New constant.Jason Rumney2003-06-051-1/+30
| | | | (w32_get_string_resource): Try SYSTEM_DEFAULT_RESOURCES last.
* (x_get_string_resource): Use XrmDatabase.Kim F. Storm2003-03-311-1/+1
|
* (w32_get_rdb_resource): New function.Juanma Barranquero2003-03-061-1/+31
| | | | | (x_get_string_resource): Use it, so resources passed with -xrm supercede the ones in the registry.
* Trailing whitespace deleted.Juanma Barranquero2003-02-041-11/+11
|
* (w32_get_string_resource): Check for name in currentAndrew Innes1999-05-021-9/+18
| | | | user area, and if not found look in the local machine area.
* Change identifiers of the form win32* to w32*.Geoff Voelker1996-11-191-2/+2
|
* (REG_ROOT): Remove trailing backslash.Geoff Voelker1996-05-031-1/+1
|
* backout 1996-01-21T00:22:24Z!voelker@cs.washington.eduGeoff Voelker1996-01-251-1/+1
|
* (REG_ROOT): Don't use trailing backslash.Geoff Voelker1996-01-211-1/+1
|
* Update FSF's address in the preamble.Erik Naggum1996-01-151-4/+7
|
* Initial revisionGeoff Voelker1995-11-071-0/+94