1. 01 Jan, 2019 1 commit
  2. 02 Jun, 2018 1 commit
    • Matthias Dahl's avatar
      Fix wait_reading_process_output wait_proc hang · de69d284
      Matthias Dahl authored
      * src/process.c (read_process_output): Track bytes read from
      a process.
      (wait_reading_process_output): If called recursively through
      timers and/or process filters via accept-process-output, it is
      possible that the output of wait_proc has already been read by
      one of those recursive calls, leaving the original call hanging
      forever if no further output arrives through that fd and no
      timeout has been set.  Fix that by using the process read
      accounting to keep track of how many bytes have been read and
      use that as a condition to break out of the infinite loop and
      return to the caller as well as to calculate the proper return
      value (if a wait_proc is given that is).
      
      * src/process.h (struct Lisp_Process): Add nbytes_read to track
      bytes read from a process.
      
      (cherry picked from commit 4ba32858)
      de69d284
  3. 01 Jan, 2018 1 commit
  4. 13 Nov, 2017 1 commit
    • Paul Eggert's avatar
      Change vectorlike from struct to union · 5d68dc9a
      Paul Eggert authored
      * src/lisp.h (vectorlike_headed): Change from struct to union.
      All uses changed.  Since it has only one member, this does not
      change semantics.  This is designed to simplify future changes
      needed to fix bugs like Bug#29040.  All uses changed.
      5d68dc9a
  5. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  6. 01 Jan, 2017 1 commit
  7. 25 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Reorder lisp.h to declare types before using them · f5b9c1e5
      Paul Eggert authored
      This puts basic functions for types to be after the corresponding
      type definitions.  This is a more-common programming style in C,
      and will make it easier to port Emacs to gcc
      -fcheck-pointer-bounds, since the functions now have access to the
      corresponding types' sizes.  This patch does not change the code;
      it just moves declarations and definitions and removes
      no-longer-needed forward declarations (Bug#25128).
      * src/buffer.c, src/data.c, src/image.c:
      Include process.h, for PROCESSP.
      * src/buffer.h (BUFFERP, CHECK_BUFFER, XBUFFER):
      * src/process.h (PROCESSP, CHECK_PROCESS, XPROCESS):
      * src/termhooks.h (TERMINALP, XTERMINAL):
      * src/window.h (WINDOWP, CHECK_WINDOW, XWINDOW):
      * src/thread.h (THREADP, CHECK_THREAD, XTHREAD, MUTEXP, CHECK_MUTEX)
      (XMUTEX, CONDVARP, CHECK_CONDVAR, XCONDVAR):
      Move here from lisp.h.
      * src/intervals.h: Include buffer.h, for BUFFERP.
      Include lisp.h, for Lisp_Object.
      * src/lisp.h: Reorder declarations and definitions as described
      above.  Move thread includes to be later, so that they can use the
      reordered definitions.  Move some symbols to other headers (noted
      elsewhere).  Remove forward decls that are no longer needed.
      * src/thread.h: Include systhread.h here, not in lisp.h,
      since lisp.h itself does not need systhread.h.
      f5b9c1e5
  8. 07 Nov, 2016 1 commit
    • Paul Eggert's avatar
      Restore file descriptor limit in subprocesses · b6d9613d
      Paul Eggert authored
      Problem reported by Philipp Stephani (Bug#24869).
      * src/callproc.c (child_setup) [!DOS_NT]:
      Call restore_nofile_limit in the child.
      * src/process.c (nofile_limit) [HAVE_SETRLIMIT]: New static var.
      (restore_nofile_limit): New function.
      (init_process_emacs) [HAVE_SETRLIMIT]: Set the new var.
      b6d9613d
  9. 11 Aug, 2016 1 commit
    • Paul Eggert's avatar
      Fix process leak with make-network-process · 2dd8044b
      Paul Eggert authored
      This problem was introduced by the recent async changes (Bug#23808).
      * src/process.c (Fmake_process): Move USE_SAFE_ALLOCA later,
      so that it follows the start_process_unwind unwind-protect.
      Set pid to -1 while the process is being created.
      (start_process_unwind): Omit unnecessary emacs_abort test.
      (connect_network_socket): Simplify use of counts.  Unwind
      bind_polling_period a bit earlier, so that a remove_process
      unwind-protect can be added when needed; this is the heart of
      the fix.  Undo the unwind-protect just before returning.
      2dd8044b
  10. 26 Jun, 2016 1 commit
    • Paul Eggert's avatar
      Try other addresses when connecting to multihomed · 2989ad90
      Paul Eggert authored
      Problem reported by Juliusz Chroboczek (Bug#17976)
      and by Artur Malabarba (Bug#23620).
      Patch from a suggestion by Andreas Schwab in:
      http://bugs.gnu.org/17976#39
      This patch is for non-MS-Windows platforms.
      I don't know the situation on MS-Windows.
      * src/process.c (connecting_status):
      New function, for (connect . ADDRINFOS).
      (connect_network_socket, check_for_dns, wait_for_socket_fds)
      (wait_while_connecting, wait_reading_process_output, status_notify):
      Use it.
      (decode_status, Fmake_network_process):
      Support (connect . ADDRINFOS) status.
      (connect_network_socket) [!WINDOWSNT]:
      If the connection failed and there are other addresses to try, do not
      signal an error; instead, loop around to try the next address.
      (wait_reading_process_output): Advance to the next address
      if there are multiple addresses and the first remaining address
      failed.
      * src/process.h (struct Lisp_Process.status): Adjust comment
      to describe (connect . ADDRINFOS).
      2989ad90
  11. 10 Jun, 2016 1 commit
    • Paul Eggert's avatar
      Fix XFASTINT of non-fixnum in process status · 560202f6
      Paul Eggert authored
      * src/process.c (decode_status): 3rd arg is now Lisp_Object *,
      not int *, and is not decoded.  All uses changed.
      (status_message): Do not assume ‘failed’ code is an integer.
      * src/process.h: Document codes better.
      560202f6
  12. 23 May, 2016 1 commit
    • Paul Eggert's avatar
      Don’t use only last protocol from getaddrinfo · 918ef715
      Paul Eggert authored
      Problem reported by Ken Brown in:
      http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00483.html
      * src/process.c (conv_addrinfo_to_lisp): New function.
      (connect_network_socket): Arg is now a list of addrinfos, not
      merely IP addresses.  All uses changed.  Use protocol from
      each addrinfo.
      (Fmake_network_process): Accumulate protocols into addrinfos
      rather than just using the last one found.
      (check_for_dns): Accumulate protocols here, too.
      * src/process.h (struct Lisp_Process): Remove ai_protocol;
      no longer needed.
      918ef715
  13. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  14. 05 Mar, 2016 1 commit
    • Lars Magne Ingebrigtsen's avatar
      Allow making TLS negotiation blocking · 21b509d4
      Lars Magne Ingebrigtsen authored
      * lisp/net/gnutls.el (gnutls-negotiate): Make negotiation blocking.
      
      * src/gnutls.c (Fgnutls_boot): Provide a new keyword,
      :complete-negotiation, to specify that we want complete
      negotiation even if the socket is non-blocking.
      (gnutls_try_handshake): Complete negotiation if given that keyword.
      
      * src/process.h (L): Added gnutls_complete_negotiation_p.
      21b509d4
  15. 25 Feb, 2016 1 commit
    • Paul Eggert's avatar
      Integer overflow cleanups for ports and socklen · c1415cc9
      Paul Eggert authored
      * src/process.c (struct sockaddr_and_len, conv_sockaddr_to_lisp)
      (get_lisp_to_sockaddr_size, Fset_process_datagram_address)
      (connect_network_socket):
      Use ptrdiff_t, not int, for signed object sizes.
      This addresses only a theoretical problem, as in practice these
      object sizes are less than 2**31, but we might as well use the
      same style here as elsewhere in Emacs.
      (string_integer_p): Remove; all uses removed.
      (Fmake_network_process): Check that port number is in range.
      When converting an integer-string service, rely on strtol
      rather than rechecking the string by hand.
      * src/process.h, src/w32.c (conv_sockaddr_to_lisp):
      Adjust prototypes to match.
      c1415cc9
  16. 23 Feb, 2016 1 commit
    • Paul Eggert's avatar
      Minor cleanups for async DNS etc. · 82848cf6
      Paul Eggert authored
      * src/frame.h (FRAME_WINDOW_CONFIGURATION_CHANGED):
      Omit unnecessary parens.
      * src/gnutls.c (gnutls_try_handshake, emacs_gnutls_deinit)
      (gnutls_verify_boot):
      Use bool for boolean.
      (ATTRIBUTE_FORMAT_PRINTF): Add printf attribute.
      * src/process.c (free_dns_request, Fmake_network_process):
      Allocate and free async request control block all in one go.
      (set_network_socket_coding_system, finish_after_tls_connection)
      (connect_network_socket):
      Now static.
      (conv_numerical_to_lisp): 2nd arg is now int, not unsigned.
      (Fmake_network_process): Use list1 for brevity.
      (wait_for_socket_fds): 2nd arg is now const ptr.
      * src/process.h (struct Lisp_Process.dns_request):
      Now struct gaicb *, not struct gaicb **, since there was always
      exactly one.  All uses changed.
      * src/window.c, src/window.h (run_window_configuration_change_hook):
      Now static.
      82848cf6
  17. 01 Feb, 2016 2 commits
  18. 31 Jan, 2016 3 commits
    • Lars Ingebrigtsen's avatar
      Further TLS async work · 4ff81f8f
      Lars Ingebrigtsen authored
      * gnutls.c (boot_error): New function to either signal an
      error or return an error code.
      (Fgnutls_boot): Don't signal errors when running asynchronously.
      
      * process.h (pset_status): Move here from process.c to be
      able to use from gnutls.c.
      
      * process.c (connect_network_socket): Do the TLS boot here
      when running asynchronously.
      (wait_reading_process_output): Rework the dns_processes
      handling for more safety.
      4ff81f8f
    • Lars Ingebrigtsen's avatar
      Rework the mechanisms for async GnuTLS connections · cecf6c9a
      Lars Ingebrigtsen authored
      * lisp/net/gnutls.el (open-gnutls-stream): Compute the
      gnutls-boot parameters and pass them to the process object.
      (gnutls-negotiate): New parameter :return-keywords that won't
      connect to anything, just compute the keywords.
      
      * lisp/url/url-http.el (url-http): Revert async TLS sentinel
      hack, which is no longer necessary.
      
      * src/gnutls.c (Fgnutls_asynchronous_parameters): Rename from
      gnutls-mark-process.
      
      * src/process.c (connect_network_socket): If we're connecting to
      an asynchronous TLS socket, complete the GnuTLS boot sequence here.
      
      * src/process.h: New parameter gnutls_async_parameters.
      cecf6c9a
    • Lars Ingebrigtsen's avatar
      Implement asynchronous GnuTLS connections · 0f47153b
      Lars Ingebrigtsen authored
      * doc/misc/emacs-gnutls.texi (Help For Developers): Mention
      the nowait parameter.
      
      * lisp/net/gnutls.el (open-gnutls-stream): Allow asynchronous
      connections with the new nowait parameter.
      
      * lisp/net/network-stream.el (network-stream-open-tls): Pass
      on :nowait to open-gnutls-stream.
      
      * lisp/url/url-http.el (url-http): Don't overwrite the
      sentinel created by open-gnutls-stream.
      
      * src/gnutls.c (Fgnutls_mark_process): New function.
      
      * src/process.c (send_process): Don't write to GnuTLS sockets that
      haven't been initialised yed.
      
      * src/process.h: New slot gnutls_wait_p.
      0f47153b
  19. 30 Jan, 2016 1 commit
  20. 29 Jan, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Implement asynchronous name resolution · fdfb6869
      Lars Ingebrigtsen authored
      * process.c (Fmake_network_process): Do asynchronous DNS
      lookups if we have getaddrinfo_a and the user requests :nowait.
      (check_for_dns): New function.
      (wait_reading_process_output): Check for pending name
      resolution in the idle loop.
      
      * process.h: Add structure for async DNS.
      fdfb6869
  21. 28 Jan, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Refactor make_network_process · e09c0972
      Lars Ingebrigtsen authored
      * src/process.c (set_network_socket_coding_system)
      (connect_network_socket): Refactor out of
      make_network_process to allow calling connect_network_socket
      asynchronously.
      (Fmake_network_process): Do nothing but parsing the parameters
      and name resolution, leaving the connection to
      connect_network_socket.
      e09c0972
  22. 01 Jan, 2016 1 commit
  23. 16 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Make src headers idempotent and standalone · 55ba8c02
      Paul Eggert authored
      Redo src/*.h so that each include file is idempotent (that is, can
      be included multiple times with the latter inclusions having no
      effect) and standalone (that is, can be included by itself,
      with no include file other than config.h needed as a prerequisite).
      This is standard practice in GNU programs nowadays.
      * lwlib/lwlib-widget.h, src/buffer.h, src/category.h, src/character.h:
      * src/charset.h, src/coding.h, src/commands.h, src/disptab.h:
      * src/fontset.h, src/gnutls.h, src/indent.h, src/keymap.h, src/macros.h:
      * src/regex.h [emacs]:
      * src/syntax.h, src/systty.h, src/termhooks.h:
      Include lisp.h, for Lisp_Object.
      * src/buffer.h, src/category.h, src/cm.h, src/commands.h, src/disptab.h:
      * src/indent.h, src/intervals.h, src/keyboard.h, src/macros.h:
      * src/process.h, src/puresize.h, src/region-cache.h, src/syntax.h:
      * src/syssignal.h, src/sysstdio.h, src/systty.h, src/termchar.h:
      * src/termopts.h, src/tparam.h, src/unexec.h:
      Protect against multiple inclusion.
      * src/buffer.h: Include character.h, for STRING_CHAR.
      * src/emacsgtkfixed.h (struct frame):
      * src/fontset.h (struct face):
      * src/region-cache.h (struct buffer):
      * src/termhooks.h (struct glyph):
      * src/xsettings.h (struct x_display_info):
      Add possibly-forward decl.
      * src/syntax.h: Include buffer.h, for BVAR.
      * src/sysselect.h: Include lisp.h, for eassume.
      * src/termchar.h: Include <stdio.h>, for FILE.
      * src/widget.h: Include <X11/IntrinsicP.h>, for Widget.
      * src/xsettings.h: Include <X11/Xlib.h>, for XEvent.
      55ba8c02
  24. 08 Sep, 2015 1 commit
  25. 10 Apr, 2015 1 commit
    • Daiki Ueno's avatar
      Add facility to collect stderr of async subprocess · f55ea05b
      Daiki Ueno authored
      * src/w32.h (register_aux_fd): New function declaration.
      * src/w32.c (register_aux_fd): New function.
      * src/process.h (struct Lisp_Process): New member stderrproc.
      * src/process.c (PIPECONN_P): New macro.
      (PIPECONN1_P): New macro.
      (Fdelete_process, Fprocess_status, Fset_process_buffer)
      (Fset_process_filter, Fset_process_sentinel, Fstop_process)
      (Fcontinue_process): Handle pipe process specially.
      (create_process): Respect p->stderrproc.
      (Fmake_pipe_process): New function.
      (Fmake_process): Add new keyword argument :stderr.
      (wait_reading_process_output): Specially handle a pipe process when
      it gets an EOF.
      (syms_of_process): Register Qpipe and Smake_pipe_process.
      
      * doc/lispref/processes.texi (Asynchronous Processes): Document
      `make-pipe-process' and `:stderr' keyword of `make-process'.
      
      * lisp/subr.el (start-process): Suggest to use `make-process' handle
      standard error separately.
      
      * test/automated/process-tests.el (process-test-stderr-buffer)
      (process-test-stderr-filter): New tests.
      
      * etc/NEWS: Mention new process type `pipe' and its usage with the
      `:stderr' keyword of `make-process'.
      f55ea05b
  26. 14 Jan, 2015 2 commits
  27. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  28. 01 Jan, 2015 2 commits
  29. 23 Nov, 2014 1 commit
    • Lars Magne Ingebrigtsen's avatar
      Add functions to gnutls.c for exporting certificate details · a8595046
      Lars Magne Ingebrigtsen authored
      * gnutls.c (gnutls_hex_string, gnutls_certificate_details)
      (Fgnutls_peer_status): New functions to export TLS certificate
      details to Emacs Lisp.
      
      * process.h: Added more fields to Lisp_Process to track
      certificate details.
      
      * gnutls.c (Fgnutls_boot): Save certificate for later inspection.
      a8595046
  30. 08 Jun, 2014 1 commit
    • Paul Eggert's avatar
      If a C name must be extern on some platforms, make it extern on all. · ff2d0e83
      Paul Eggert authored
      * dispextern.h (set_vertical_scroll_bar, erase_phys_cursor)
      (load_color):
      * font.h (ftxfont_driver) [HAVE_XFT]:
      * keyboard.h (menu_items_inuse, ignore_mouse_drag_p, make_ctrl_char):
      * lisp.h (get_frame_param):
      * menu.h (tty_menu_show):
      * process.h (conv_sockaddr_to_lisp, catch_child_signal):
      * termhooks.h (encode_terminal_code):
      * xterm.h (x_menu_wait_for_event):
      Always declare.
      * frame.c (get_frame_param):
      * fringe.c (max_used_fringe_bitmap):
      * ftxfont.c (ftxfont_driver):
      * keyboard.c (ignore_mouse_drag_p, make_ctrl_char):
      * menu.c (menu_items_inuse):
      * process.c (conv_sockaddr_to_lisp, catch_child_signal):
      * term.c (encode_terminal_code, tty_menu_show):
      * xdisp.c (set_vertical_scroll_bar, erase_phys_cursor):
      * xfaces.c (load_color):
      * xmenu.c (x_menu_wait_for_event):
      Now always extern.
      ff2d0e83
  31. 01 Jun, 2014 1 commit
    • Paul Eggert's avatar
      Port signal-handling to DragonFly BSD. · 5c2b9423
      Paul Eggert authored
      * callproc.c, sysdep.c (block_child_signal, unblock_child_signal):
      Move implementations from callproc.c to sysdep.c.
      * process.h, syssignal.h (block_child_signal, unblock_child_signal):
      Move declaratations from process.h to syssignal.h.
      
      Fixes: debbugs:17646
      5c2b9423
  32. 25 Mar, 2014 1 commit
    • Paul Eggert's avatar
      Handle sigmask better with nested signal handlers. · 1e952f0a
      Paul Eggert authored
      * atimer.c (sigmask_atimers): Remove.
      Remaining use rewritten to use body of this function.
      * atimer.c (block_atimers, unblock_atimers):
      * callproc.c (block_child_signal, unblock_child_signal):
      * sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
      New arg OLDSET.  All callers changed.
      * atimer.c (block_atimers, unblock_atimers):
      * callproc.c (block_child_signal, unblock_child_signal):
      * keyboard.c (handle_interrupt):
      * sound.c (vox_configure, vox_close):
      Restore the old signal mask rather than unilaterally clearing bits
      from the mask, in case a handler is running within another
      handler.  All callers changed.
      * lisp.h, process.c, process.h, term.c:
      Adjust decls and callers to match new API.
      * sysdep.c (emacs_sigaction_init): Don't worry about masking SIGFPE;
      signal handlers aren't supposed to use floating point anyway.
      (handle_arith_signal): Unblock just SIGFPE rather than clearing mask.
      
      Fixes: debbugs:15561
      1e952f0a
  33. 01 Jan, 2014 1 commit
  34. 14 Dec, 2013 1 commit
    • Paul Eggert's avatar
      Use bool for boolean, focusing on headers. · 96c06863
      Paul Eggert authored
      * configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK):
      Use bool for boolean.
      * lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE):
      Remove.  All uses replaced with uncapitalized version.
      * lib-src/emacsclient.c (message):
      * lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names):
      * lib-src/hexl.c (un_flag, iso_flag, endian):
      * lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next)
      (pop_trash):
      Use bool for boolean.
      * lib-src/etags.c (bool): Remove.
      * lib-src/etags.c (globals, members, declarations, no_line_directive)
      (no_duplicates): Use 'int' for boolean values that getopt requires
      to be 'int'.  Formerly, these were 'bool' and 'bool' was 'int',
      but we can no longer rely on this implementation.
      * lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields.
      * lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields.
      * src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c:
      No need to include <stdbool.h>, since conf_post.h does it now.
      * src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION)
      (BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P)
      (SET_PER_BUFFER_VALUE_P):
      * src/ccl.c, src/ccl.h (setup_ccl_program):
      * src/ccl.h (CHECK_CCL_PROGRAM):
      * src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR)
      (CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY)
      (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE)
      (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
      (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
      (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
      (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS):
      * src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
      (CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET)
      (CHARSET_FAST_MAP_SET):
      * src/coding.c (decode_coding_ccl, encode_coding_ccl):
      * src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC)
      (CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2)
      (JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE)
      (ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8)
      (decode_coding_c_string):
      * src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE):
      * src/conf_post.h (has_attribute):
      * src/dispextern.h (trace_redisplay_p):
      (INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE)
      (SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH)
      (SET_GLYPH_FROM_CHAR_GLYPH):
      (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P)
      (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P)
      (PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p)
      (cursor_in_mouse_face_p):
      * src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows)
      (blank_row, prepare_desired_row)
      (build_frame_matrix_from_leaf_window, make_current)
      (mirror_make_current, mirrored_line_dance, mirror_line_dance)
      (update_window, scrolling_window, update_frame_line):
      * src/disptab.h (GLYPH_FOLLOW_ALIASES):
      * src/editfns.c (Fformat):
      * src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC)
      (FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE)
      (FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC)
      (FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC)
      (FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY)
      (CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG)
      (FONT_DEFERRED_LOG):
      * src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P):
      (FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME)
      (FRAME_MOUSE_UPDATE):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask)
      (x_create_bitmap_from_xpm_data, xpm_load_image):
      * src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT)
      (set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE)
      (MERGE_INTERVAL_CACHE):
      * src/keymap.h (KEYMAPP):
      * src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE)
      (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP)
      (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER)
      (CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER)
      (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
      (DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT)
      (RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE)
      (SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp):
      * src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX)
      (UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
      (SETUP_BUFFER_SYNTAX_TABLE):
      * src/systime.h (timespec_valid_p):
      * src/term.c (save_and_enable_current_matrix):
      * src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P):
      * src/xdisp.c (in_display_vector_p, display_tool_bar_line)
      (redisplay_internal, try_window_reusing_current_matrix)
      (sync_frame_with_window_matrix_rows, try_window_id)
      (display_menu_bar, display_tty_menu_item, display_mode_line)
      (coords_in_mouse_face_p, cursor_in_mouse_face_p):
      * src/xmenu.c (xmenu_show):
      * src/xterm.c (use_xim, x_term_init):
      * src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET)
      (struct x_bitmap_record):
      Use bool for booleans.
      * src/ccl.c (struct buffer_text):
      * src/ccl.h (struct ccl_program):
      * src/charset.h (struct charset):
      * src/cm.h (struct cm):
      * src/coding.h (struct iso_2022_spec, struct coding_system):
      * src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row)
      (struct glyph_string, struct face, struct face_cache)
      (struct bidi_string_data, struct bidi_it)
      (struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo)
      (struct image):
      * src/editfns.c (Fformat):
      * src/frame.h (struct frame):
      * src/fringe.c (struct fringe_bitmap):
      * src/intervals.h (struct interval):
      * src/keyboard.h (struct kboard):
      * src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker)
      (struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free)
      (struct Lisp_Buffer_Local_Value, union specbinding):
      * src/macfont.m (struct macfont_info):
      * src/process.h (struct Lisp_Process):
      * src/termchar.h (struct tty_display_info):
      * src/window.h (struct window):
      * src/xterm.h (struct x_output):
      Use bool_bf for boolean bit-fields.
      * src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0.
      All callers changed.
      * src/ccl.h (struct ccl_program): Remove unused members private_state,
      src_multibyte, dst_multibyte, cr_consumed, suppress_error,
      eight_bit_control.
      (struct ccl_spec): Remove unused members cr_carryover,
      eight_bit_carryover.
      * src/conf_post.h: Include <stdbool.h>.
      (bool_bf): New type.
      * src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
      * src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
      Surround statement macro with proper 'do { ... } while (false)' brackets.
      (SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool.
      (PRODUCE_GLYPHS): Simplify use of boolean.
      * src/fileio.c (Fcopy_file):
      If I is an integer, prefer 'if (I != 0)' to 'if (I)'.
      * src/lisp.h (UNGCPRO): Return void, not int.
      (FOR_EACH_TAIL): Use void expression, not int expression.
      * src/region-cache.c: Reindent.
      * src/region-cache.h: Copy comments from region-cache.c, to fix
      incorrect remarks about booleans.
      96c06863
  35. 17 Oct, 2013 1 commit
    • Paul Eggert's avatar
      Make some functions static in non-Microsoft builds. · 3d798ba7
      Paul Eggert authored
      On my platform (Fedora 19 x86-64), this shrinks the
      Emacs executable (text+data) by 0.25%.
      * dispextern.h (erase_phys_cursor) [!WINDOWSNT]:
      (load_color) [!MSDOS]:
      * gnutls.h (emacs_gnutls_transport_set_errno) [!WINDOWSNT]:
      * keyboard.h (make_ctrl_char) [!WINDOWSNT]:
      * lisp.h (check_existing):
      * process.h (conv_sockaddr_to_lisp, network_interface_list)
      (network_interface_info) [!WINDOWSNT]:
      * termhooks.h (encode_terminal_code) [!WINDOWSNT]:
      Remove extern decls.
      * fileio.c (check_existing):
      * keyboard.c (make_ctrl_char) [!WINDOWSNT]:
      * process.c (conv_sockaddr_to_lisp, network_interface_list)
      (network_interface_info) [!WINDOWSNT]:
      * term.c (encode_terminal_code) [!WINDOWSNT]:
      * xdisp.c (erase_phys_cursor) [!WINDOWSNT]:
      * xfaces.c (load_color) [!MSDOS]:
      Now static.
      * fileio.c (check_existing, check_executable, check_writable):
      * process.c (network_interface_list, network_interface_info):
      Move earlier, so that we don't need forward decls.
      * gnutls.c (fn_gnutls_transport_set_errno)
      (emacs_gnutls_transport_set_errno) [!WINDOWNT]:
      Remove; unused.
      * w32.c (init_environment): Use faccessat rather than
      check_existing, partly for consistency with the rest of the code
      in this file, partly so that check_existing can be static.
      3d798ba7