1. 10 Aug, 2016 1 commit
    • Paul Eggert's avatar
      Omit unnecessary process initialization · cd352406
      Paul Eggert authored
      * src/process.c (make_process, Fmake_process)
      (Fmake_pipe_process, Fmake_serial_process)
      (Fmake_network_process, server_accept_connection):
      Omit unnecessary initialization of already-cleared storage.
      cd352406
  2. 02 Aug, 2016 1 commit
  3. 21 Jul, 2016 1 commit
  4. 05 Jul, 2016 1 commit
    • Paul Eggert's avatar
      Fix open-network-stream responsiveness · a5dcc97b
      Paul Eggert authored
      Problem reported by Christer Ekholm (Bug#23864).
      Backport from master.
      * src/process.c (wait_reading_process_output):
      Fix typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu
      when wait == INFINITY and got_output_end_time is invalid.
      In this case the code should break, not continue.
      a5dcc97b
  5. 03 Jul, 2016 2 commits
    • Paul Eggert's avatar
      Re-fix open-network-stream responsiveness · 838f1228
      Paul Eggert authored
      Problem reported by Christer Ekholm (Bug#23864).
      * src/process.c (wait_reading_process_output): Further fix for
      typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu when
      wait == INFINITY and got_output_end_time is invalid.  See:
      http://bugs.gnu.org/23864#20
      838f1228
    • Paul Eggert's avatar
      Fix open-network-stream responsiveness · 1e97ecb9
      Paul Eggert authored
      Problem reported by Constantin Kulikov (Bug#23684).
      * src/process.c (wait_reading_process_output):
      Fix typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu
      when wait == INFINITY and got_output_end_time is invalid.
      In this case the code should break, not continue.
      1e97ecb9
  6. 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
  7. 12 Jun, 2016 1 commit
    • Paul Eggert's avatar
      New macro GNUC_PREREQ for GCC version · ab182c62
      Paul Eggert authored
      * src/conf_post.h (GNUC_PREREQ): New macro.
      Change uses of __GNUC_MINOR__ and __GNUC_PATCHLEVEL__ to use this
      macro instead, for clarity and consistency.
      (PRINTF_ARCHETYPE): New macro.  Define it to __gnu_printf__ only
      if glibc, since non-GNU platforms don’t necessarily support GNU
      printf formats.
      (ATTRIBUTE_FORMAT_PRINTF): Use it.
      ab182c62
  8. 10 Jun, 2016 2 commits
    • Paul Eggert's avatar
      Prefer getsockopt to getpeername on non-MS-Windows · 07b77b8e
      Paul Eggert authored
      * admin/CPP-DEFINES: Remove HAVE_GETPEERNAME.
      * configure.ac: Don’t check for getpeername.
      * src/process.c (wait_reading_process_output) [!WINDOWSNT]:
      Use getsockopt even if not GNU/Linux, as the platforms where
      getsockopt used to hang are no doubt long dead.
      07b77b8e
    • 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
  9. 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
  10. 22 May, 2016 2 commits
    • Alp Aker's avatar
      * src/process.c (SOCK_NONBLOCK): Fix typo. · 848d487c
      Alp Aker authored
      848d487c
    • Paul Eggert's avatar
      Prefer SOCK_NONBLOCK to O_NONBLOCK · f2d03334
      Paul Eggert authored
      * src/process.c (SOCK_NONBLOCK): Define to 0 if not already defined.
      (connect_network_socket): Create the socket with SOCK_NONBLOCK, to
      avoid an fcntl with O_NONBLOCK if SOCK_NONBLOCK works.  Put the
      SOCK_DGRAM check a bit later, to keep the logic cleaner, as
      the order does not matter here.
      f2d03334
  11. 21 May, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix compiler warnings in the MinGW build · cb5af792
      Eli Zaretskii authored
      * configure.ac [mingw32]: Don't add -Wpointer-sign, and add
      -Wno-pointer-sign, to keep the noise level down.
      
      * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
      -Wredundant-decls, as that produces a lot of noise due to
      redeclaration of time-related functions by gnulib.
      * nt/runemacs.c (set_user_model_id): Fix argument type of
      'SetCurrentProcessExplicitAppUserModelID'.
      
      * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
      declare 'dpyinfo', as it is unused.
      (xpm_load): Fix warnings about pointer signedness.
      * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
      prototypes.
      (sys_spawnve): Avoid warnings about discarding 'const' qualifier.
      (sys_select): Provide prototype.
      (g_b_init_compare_string_w): Move declaration to file scope.
      * src/w32heap.c (dumped_data_commit): Now static.
      (FREEABLE_P): Avoid warnings about pointer comparison with integer.
      (mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
      * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
      (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
      Provide prototypes.
      * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
      redundant prototypes.
      (w32_get_internal_run_time, map_w32_filename): Provide prototype.
      (init_environment, sys_ctime): Avoid warnings about discarding
      'const' qualifier.
      Include utimens.h.
      (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
      (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
      (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
      prototypes.
      (sys_rename_replace): Use %d to avoid compiler warnings.
      (_wsa_errlist): Make the message text 'const char *', to avoid
      compilation warnings.
      (dynlib_reset_last_error): Move prototype to file scope.
      (w32_get_resource): First argument is now 'const char *'.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
      (otf_features): Second argument is no 'const char *'.
      * src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
      (x_set_window_size): Remove redundant prototypes.
      (XChangeGC, XGetGCValues, w32_draw_underwave)
      (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
      (x_calc_absolute_position, x_destroy_window): Now static.
      (menubar_selection_callback): Move prototype to file scope.
      * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
      declaration.
      (w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
      (w32font_full_name): Fix warnings about implicit conversion of
      'float' to 'double'.
      * src/w32reg.c (w32_get_rdb_resource): Fix warnings about
      discarding 'const' qualifier.
      * src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
      (set_frame_menubar): Remove redundant prototypes.
      (menubar_selection_callback, w32_menu_display_help): Provide
      prototypes.
      (simple_dialog_show): Avoid warnings about discarding 'const'
      qualifier.
      * src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
      (free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
      (x_set_tool_bar_lines, x_set_internal_border_width): Remove
      redundant prototypes.
      (current_popup_menu): Remove redundant declaration.
      (colormap_t): Member 'name' is now 'const char *'.
      (add_system_logical_colors_to_map): Fix signed/unsigned warnings.
      (x_decode_color, x_set_border_pixel)
      (x_clear_under_internal_border, x_set_name, hook_w32_key)
      (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
      static.
      (w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
      (w32_msg_worker, w32_last_error): Provide prototypes.
      (funhook, lookup_vk_code): Avoid warnings about missing
      parentheses.
      (x_default_font_parameter, Fw32_notification_notify): Avoid
      warnings about discarding 'const' qualifier.
      (Fx_create_frame): Avoid warnings about empty body of 'else'.
      (x_screen_planes): Ifdef away unused function.
      (Fx_show_tip): Remove unused variables.
      (Fw32_battery_status): Avoid warnings about implicit promotion
      from float to double.
      (Fw32_notification_notify): Initialize 'timeout'.
      * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
      define the TIMER_SETTIME_RUNNING value if it will be used.
      * src/w32notify.c (send_notifications): Ifdef away an empty if
      clause.  Remove unused variable.
      (watch_end, watch_completion): Provide prototypes.
      * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
      * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
      warning with pointer signedness.
      * src/gnutls.c (gnutls_x509_crt_get_signature)
      (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
      don't load them from the GnuTLS library, as they are no longer
      used.
      * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
      define, as it's unused.
      * src/unexw32.c (open_input_file, open_output_file)
      (close_file_data): Remove redundant prototypes.
      (_start): provide prototype.
      (mainCRTStartup): Move prototype to file level.
      (find_section): Use type-cast to shut up compiler warnings.
      (offset_to_section, relocate_offset): Now static.
      (find_section): First argument is now a 'const char *'.
      (offset_to_section): Ifdef away, as it's unused.
      * src/w32heap.h (find_section): Adjust prototype.
      * src/dynlib.c (dynlib_reset_last_error): Provide prototype.
      * src/dired.c (directory_files_internal_w32_unwind): Avoid
      warnings about missing prototypes.
      (is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
      (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
      signedness.
      * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
      Fix warnings about pointer signedness.
      * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
      unused.
      * src/sysdep.c (_getpid): Remove redundant prototype.
      (sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
      [!MSDOS]: Don't define 'st', it's unused.
      (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
      (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
      * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
      n_to_read, as it is not used.
      (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
      * src/w32font.h (syms_of_w32font): Remove redundant prototype.
      * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
      * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
      not used by DOS_NT builds, to avoid compiler warnings.
      * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
      declaration.
      * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
      up compiler warnings.
      * src/w32term.h (x_set_window_size, x_get_focus_frame)
      (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
      (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
      (x_free_frame_resources, x_real_positions)
      (display_x_get_resource): Remove redundant prototypes.
      
      * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
      (sys_rename, gettimeofday): Provide prototypes.
      * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
      declarations.
      * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
      (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
      (close_winsock, initialize_sockets, w32_set_user_model_id)
      (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
      prototypes.
      (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
      difference.
      (w32_set_user_model_id): Update prototype of
      SetCurrentProcessExplicitAppUserModelID to avoid compiler
      warnings.
      (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
      shut up compiler warnings.
      * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
      cb5af792
  12. 18 May, 2016 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 6.1 · 374f6a5f
      Paul Eggert authored
      * configure.ac (WERROR_CFLAGS): Omit -Wunused-const-variable=2.
      * lib-src/etags.c (LOOKING_AT, LOOKING_AT_NOCASE):
      Omit test whether pointer plus a constant equals a null pointer.
      * src/alloc.c (compact_small_strings):
      Avoid pointer arithmetic on null pointers.
      * src/alloc.c (mark_face_cache):
      * src/fontset.c (free_realized_fontsets, Fset_fontset_font):
      * src/fringe.c (draw_fringe_bitmap_1)
      (Fset_fringe_bitmap_face):
      * src/macfont.m (macfont_draw):
      * src/msdos.c (IT_set_face, IT_clear_screen):
      * src/nsfont.m (nsfont_draw):
      * src/nsterm.h (FRAME_DEFAULT_FACE):
      * src/nsterm.m (ns_draw_window_cursor)
      (ns_draw_vertical_window_border, ns_draw_window_divider)
      (ns_dumpglyphs_box_or_relief)
      (ns_maybe_dumpglyphs_background, ns_dumpglyphs_image)
      (ns_dumpglyphs_stretch):
      * src/w32term.c (w32_draw_vertical_window_border)
      (w32_draw_window_divider, x_set_mouse_face_gc):
      * src/xdisp.c (estimate_mode_line_height, init_iterator)
      (handle_face_prop, handle_single_display_spec, pop_it)
      (CHAR_COMPOSED_P, get_next_display_element)
      (next_element_from_display_vector, extend_face_to_end_of_line)
      (fill_gstring_glyph_string,BUILD_COMPOSITE_GLYPH_STRING):
      * src/xfaces.c (Finternal_merge_in_global_face, Fface_font)
      (lookup_named_face):
      * src/xterm.c (x_draw_vertical_window_border)
      (x_draw_window_divider, x_set_mouse_face_gc):
      Prefer FACE_OPT_FROM_ID to FACE_FROM_ID when the result might be null.
      * src/xterm.c (try_window_id):
      Redo loop to convince GCC 6.1 that it is null pointer safe.
      (x_color_cells):
      Use eassume as necessary to pacify GCC 6.1.
      * src/dispextern.h (FACE_FROM_ID, IMAGE_FROM_ID): Now returns non-null.
      (FACE_OPT_FROM_ID, IMAGE_OPT_FROM_ID): New macro, with the old
      behavior of the non-_OPT macro, to be used when the result
      might be a null pointer.
      * src/dispnew.c (buffer_posn_from_coords, marginal_area_string)
      [HAVE_WINDOW_SYSTEM]:
      * src/intervals.h (INTERVAL_WRITABLE_P):
      * src/term.c (turn_off_face):
      * src/xdisp.c (get_glyph_face_and_encoding, fill_image_glyph_string)
      (produce_image_glyph, produce_xwidget_glyph):
      * src/xfaces.c (lookup_named_face):
      Remove unnecessary test for null pointer.
      * src/keyboard.c (read_char): Suppress bogus -Wclobbered warning.
      * src/process.c (would_block): New function.
      (server_accept_connection, wait_reading_process_output, send_process):
      Use it.
      * src/xdisp.c (get_window_cursor_type, note_mouse_highlight):
      Prefer IMAGE_OPT_FROM_ID to IMAGE_FROM_ID when the result
      might be null.
      374f6a5f
  13. 13 May, 2016 1 commit
  14. 07 May, 2016 1 commit
  15. 02 May, 2016 1 commit
    • Aaron Conole's avatar
      Fix the call to set_network_coding_system · 4639bc99
      Aaron Conole authored
      * src/process.c (Fmake_network_process): A recent commit
      modified the set_network_socket_coding_system function to take
      arguments host, service, and name. However, those arguments
      appear to be swapped.
      
        Copyright-paperwork-exempt: yes
      4639bc99
  16. 30 Apr, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix the MSDOS build · ccdaf04c
      Eli Zaretskii authored
      * config.bat:
      * msdos/sedlisp.inp:
      * msdos/sedlibmk.inp:
      * msdos/sedleim.inp:
      * msdos/sedadmin.inp:
      * msdos/sed6.inp:
      * msdos/sed3v2.inp:
      * msdos/sed2v2.inp:
      * msdos/sed1v2.inp: Adapt to Emacs 25.
      
      * src/process.c (remove_slash_colon): Move out of "#ifdef
      subprocesses" block, as it its called unconditionally.  Move
      ADD_SUBFEATURE calls into "#ifdef subprocesses" block, as they
      reference variables only defined in that block.
      * src/msdos.h: Provide prototypes for IT_set_frame_parameters,
      faccessat, msdos_fatal_signal, syms_of_msdos, pthread_sigmask,
      dos_keysns, dos_keyread, run_msdos_command, and
      syms_of_win16select, to avoid compiler warnings.
      * src/msdos.c (SYS_ENVIRON): Define to either '_environ' or
      'environ', depending on the DJGPP version.
      Remove declarations of externally-visible Lisp objects, like
      Qbackground_color and Qreverse.
      (run_msdos_command): First argument is not signed, not unsigned.
      Use SYS_ENVIRON.
      (sys_select): Use 'timespec_cmp' instead of 'timespec_sign', as
      the latter doesn't work when 'time_t' is an unsigned data type.
      This caused idle timers to behave incorrectly: they only fired
      after a keyboard input event.
      * src/frame.c (adjust_frame_size) [MSDOS]: Account for
      FRAME_TOP_MARGIN that isn't counted in the frame's number of
      lines, but dos_set_window_size needs it to be added.
      * src/lread.c (INFINITY, NAN) [DJGPP < 2.05]: Provide definitions.
      * src/fns.c (sort_vector_copy) [__GNUC__ < 4]: Provide a prototype
      that works around compilation errors with older GCC versions.
      * src/w16select.c: Don't declare QCLIPBOARD and QPRIMARY as Lisp
      Objects.
      * src/filelock.c [MSDOS]: Ifdef away most of the code.  Provide
      no-op implementations for 'lock_file' and 'unlock_file'.
      (Ffile_locked_p) [MSDOS]: Always return nil.  This avoids multiple
      ifdefs in all users of filelock.c functionality.
      * src/conf_post.h (EOVERFLOW, SIZE_MAX) [DJGPP < 2.04]: Define.
      * src/emacs.c [MSDOS]: Include dosfns.h, to avoid compiler
      warnings.
      * src/dosfns.h: Provide prototypes for dos_cleanup,
      syms_of_dosfns, and init_dosfns.
      * src/deps.mk (atimer.o): Depend on msdos.h.
      (emacs.o): Depend on dosfns.h.
      * src/atimer.c [MSDOS]: Include msdos.h, to avoid compiler
      warnings.
      
      * lisp/window.el (window--adjust-process-windows): Skip the body
      if 'process-list' is not available.  This avoids failure to start
      up on MS-DOS.
      * lisp/vc/diff.el (diff-no-select): Test 'make-process', not
      'start-process', as the latter is now available on all platforms.
      * lisp/textmodes/ispell.el (ispell-async-processp): Replace
      'start-process' with 'make-process' in a comment.
      * lisp/term/internal.el (IT-unicode-translations): Modify and add
      a few translations to display Info files with Unicode markup.  Fix
      an ancient off-by-one mismatch error with Unicode codepoints.
      * lisp/progmodes/compile.el (compilation-start): Test
      'make-process', not 'start-process', as the latter is now
      available on all platforms.
      * lisp/man.el (Man-build-man-command, Man-getpage-in-background):
      Test 'make-process', not 'start-process', as the latter is now
      available on all platforms.
      * lisp/international/mule-cmds.el (set-coding-system-map): Test
      'make-process', not 'start-process', as the latter is now
      available on all platforms.
      * lisp/eshell/esh-cmd.el (eshell-do-pipelines-synchronously): Doc
      fix.
      (eshell-execute-pipeline): Test 'make-process', not
      'start-process', as the latter is now available on all platforms.
      ccdaf04c
  17. 26 Apr, 2016 1 commit
  18. 18 Apr, 2016 1 commit
    • Paul Eggert's avatar
      Minor fixups for external socket launching · 531c9a43
      Paul Eggert authored
      * configure.ac (HAVE_LIBSYSTEMD): Change earliest version to 222.
      * doc/emacs/misc.texi (Emacs Server):
      * etc/NEWS: Spelling and doc fixes.
      * src/emacs.c (main) [HAVE_LIBSYSTEMD]:
      Check for sd_is_socket returning positive, not zero.
      * src/process.c (external_sock_fd): Instead of initializing here ...
      (init_process_emacs): ... initialize it here, so that it does the
      right thing after dump/restore.
      (connect_network_socket): Simplify socket_to_use test.
      531c9a43
  19. 16 Apr, 2016 1 commit
    • Matthew Leach's avatar
      Add external socket launching support · e390b7b5
      Matthew Leach authored
      * src/process.c (connect_network_socket): Allow a pre-allocated socket
      descriptor to be used if passed to Emacs, avoiding the call to
      'socket' and 'bind'.
      (Fmake_network_process): Allow users to pass ':use-external-socket' in
      the parameter plist to use any sockets that have been passed to Emacs.
      (wait_reading_process_output): Call 'socket' and 'bind' every time.
      (syms_of_process): New symbol ':use-external-socket'.
      (set_external_socket_descriptor): New function.
      (external_sock_fd): New variable.
      * src/lisp.h: (set_external_socket_descriptor): New declaration.
      * src/emacs.c (main): Call 'sd_listen_fds' to read the number of sockets
      passed and call 'set_external_socket_descriptor' to set the external
      socket.
      * src/Makefile.in: Add libsystemd library and C flags to the Emacs
      compilation options.
      
      * configure.ac: Add new default-on option "systemd" and check for
      libsystemd at configure time.
      
      * lisp/server.el (server-start): Set ':use-external-socket' to 't' when
      calling 'make-network-process'.
      
      * etc/NEWS: Document new socket-passing functionality and the configure
      option to disable systemd interaction.
      
      * doc/emacs/misc.texi (Emacs Server): Document systemd socket passing
      functionality and provide systemd unit examples.
      * doc/lispref/processes.texi (Network Processes): Document new
      'make-network-process' option ':use-external-socket'.
      e390b7b5
  20. 05 Apr, 2016 1 commit
    • Paul Eggert's avatar
      Prefer AUTO_STRING_WITH_LEN to make_formatted_string · b4c7869e
      Paul Eggert authored
      * src/buffer.c (Fgenerate_new_buffer_name):
      * src/filelock.c (get_boot_time):
      * src/minibuf.c (get_minibuffer):
      * src/process.c (make_process):
      * src/xdisp.c (ensure_echo_area_buffers):
      Prefer AUTO_STRING_WITH_LEN + sprintf to make_formatted_string
      when either will do.
      b4c7869e
  21. 04 Apr, 2016 1 commit
  22. 22 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Assume NON_BLOCKING_CONNECT (Bug#22946) · 780a605e
      Paul Eggert authored
      * lisp/proced.el (proced-signal-list): Omit comment about
      obsolete systems that do not support POSIX 1003.1-2001 signals.
      * src/process.c (NON_BLOCKING_CONNECT): Remove, since we can now
      assume POSIX 1003.1-2001 or better here.  Assume it’s defined.
      (connect_network_socket): Assume EINPROGRESS is defined,
      as that’s portable too now.
      (Fmake_network_process): Use bool for boolean.
      780a605e
  23. 10 Mar, 2016 2 commits
    • 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
    • Paul Eggert's avatar
      Minor fixes for getaddrinfo_a usage · f0b31080
      Paul Eggert authored
      * src/process.c (Fdelete_process): Check gai_cancel return value.
      That way, there’s no need to invoke gai_error.  Check gai_suspend
      return value.
      (Fmake_network_process): Don’t assume gai_strerror returns a UTF-8
      string.  Simplify call to connect_network_socket.
      (check_for_dns): Avoid unnecessary initialization of local.
      f0b31080
  24. 08 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Assume getaddrinfo in C code · 59c7a5d7
      Paul Eggert authored
      * admin/CPP-DEFINES, configure.ac: Remove HAVE_GETADDRINFO, HAVE_H_ERRNO.
      All uses removed.
      * doc/lispref/processes.texi (Network, Network Processes), etc/NEWS:
      Say that port numbers can be integer strings.
      * lib-src/pop.c (h_errno) [!WINDOWSNT && !HAVE_H_ERRNO]: Remove decl.
      (socket_connection): Assume HAVE_GETADDRINFO.
      * lisp/mpc.el (mpc--proc-connect):
      * lisp/net/network-stream.el (open-network-stream):
      It’s now OK to use integer strings as port numbers.
      * src/process.c (conv_numerical_to_lisp) [!HAVE_GETADDRINFO]: Remove.
      (Fmake_network_process): Assume HAVE_GETADDRINFO.
      59c7a5d7
  25. 07 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Remove support for IRIX · 6bc8689c
      Paul Eggert authored
      The IRIX port wasn’t really working anyway, and the code was
      getting in the way of other changes (e.g., getaddrinfo fixes).
      IRIX’s supplier dropped support for IRIX in 2013.
      * admin/CPP-DEFINES:
      * configure.ac (opsys):
      * doc/lispref/os.texi (System Environment):
      * etc/MACHINES, etc/PROBLEMS:
      * lisp/find-dired.el (find-grep-options):
      * lisp/lpr.el (lpr-lp-system):
      * lisp/ls-lisp.el (ls-lisp-emulation):
      * lisp/mail/rmail.el (rmail-spool-directory):
      * lisp/net/net-utils.el (ping-program-options):
      * lisp/progmodes/gud.el (gud-irix-p, gud-dbx-use-stopformat-p):
      * lisp/progmodes/ps-mode.el (ps-mode-print-function):
      * src/conf_post.h [IRIX6_5]:
      * src/emacs.c (Vsystem_type):
      * src/filelock.c (get_boot_time_1):
      * src/process.c (process_send_signal):
      * src/unexelf.c (unexec):
      Omit IRIX-specific code and/or documentation.
      * configure.ac (NON_GCC_TEST_OPTIONS, IRIX6_5, PREFER_VSUSP):
      Remove.  All uses removed.
      * etc/NEWS: Document the change.
      6bc8689c
  26. 03 Mar, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Ensure TLS negotiation progress · 0c5c04d5
      Lars Ingebrigtsen authored
      * src/gnutls.h (GNUTLS_EMACS_HANDSHAKES_LIMIT): Increase the
      number of retries so that we try for about a minute.
      
      * src/process.c (wait_reading_process_output): Ensure progress
      for DNS resolution and TLS negotiation.
      0c5c04d5
  27. 29 Feb, 2016 3 commits
  28. 25 Feb, 2016 2 commits
    • 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
    • Lars Ingebrigtsen's avatar
      Allow using "number strings" as services on non-GNU systems · e7650ba6
      Lars Ingebrigtsen authored
      * src/process.c (string_integer_p): New function.
      (Fmake_network_process): Use it to allow connecting to
      services specified as "993" even when getaddrbyname isn't
      available.
      e7650ba6
  29. 24 Feb, 2016 1 commit
  30. 23 Feb, 2016 2 commits
    • Paul Eggert's avatar
      Port to --enable-gcc-warnings sans getaddrinfo_a · c7b8194c
      Paul Eggert authored
      * src/process.c (Fmake_network_process): Add ATTRIBUTE_UNUSED
      to a local unused when getaddrinfo_a is missing.
      Resize portbuf to size needed.  Do cheap test first.
      Move local to block where it’s needed.
      c7b8194c
    • 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
  31. 22 Feb, 2016 2 commits
    • Lars Ingebrigtsen's avatar
      Fix async TLS boot problem · 87e9e1b6
      Lars Ingebrigtsen authored
      * src/process.c (wait_reading_process_output): Verify the boot
      of the correct process.
      87e9e1b6
    • Lars Ingebrigtsen's avatar
      Clean up debugging code · f5007492
      Lars Ingebrigtsen authored
      * src/process.c (Fmake_network_process): Remove debugging printf.
      (wait_for_socket_fds, wait_while_connecting)
      (wait_for_tls_negotiation): Remove newlines from messages.
      f5007492