1. 01 Jan, 2019 1 commit
  2. 01 Jan, 2018 1 commit
  3. 30 Sep, 2017 1 commit
  4. 01 Jan, 2017 1 commit
  5. 30 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Rename primary_thread to main_thread · 108ef803
      Paul Eggert authored
      This avoids the confusion of using two different phrases "main thread"
      and "primary thread" internally to mean the same thing.  See:
      http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html
      * src/thread.c (main_thread): Rename from primary_thread,
      since the new name no longer clashes with main_thread_id
      and Emacs internals normally call this the "main thread".
      (init_main_thread): Rename from init_primary_thread.
      (main_thread_p): Rename from primary_thread_p.
      All uses changed.
      108ef803
  6. 07 Dec, 2016 1 commit
  7. 28 Nov, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix 'expand-file-name' during startup on MS-Windows · 5878abf8
      Eli Zaretskii authored
      * src/w32.c (w32_init_file_name_codepage): New function, resets
      file_name_codepage and w32_ansi_code_page to undo the values
      recorded during dumping.
      (codepage_for_filenames): Fix an embarrassing typo.  Ignore the
      cached value of file-name encoding if it is nil, i.e. not
      initialized yet.  Actually cache the last used file-name encoding
      to avoid calling APIs when not necessary.
      
      * src/w32.h (w32_init_file_name_codepage): Add prototype.
      
      * src/w32term.c (syms_of_w32term): Set the value of
      w32_unicode_filenames according to the OS version.  This avoids
      resetting it during startup, which then causes temacs to run with
      the incorrect value.
      
      * src/emacs.c (main): Call w32_init_file_name_codepage early
      during the startup.
      
      * src/fileio.c (Fexpand_file_name) [WINDOWSNT]: Update 'newdir'
      after converting $HOME to a UTF-8 string, so that 'newdirlim' is
      consistent with it.  (Bug#25038)
      
      * lisp/international/mule-cmds.el (set-locale-environment): Set
      'default-file-name-coding-system' to the ANSI codepage even in
      non-interactive sessions.
      
      * lisp/files.el (directory-abbrev-alist, abbreviated-home-dir):
      Doc fix.
      (abbreviate-file-name): Decode 'abbreviated-home-dir' if it is a
      unibyte string.
      
      * doc/lispref/files.texi (Directory Names): Index
      'directory-abbrev-alist'.
      5878abf8
  8. 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
  9. 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
  10. 20 Jan, 2016 1 commit
  11. 16 Jan, 2016 1 commit
    • Jussi Lahdenniemi's avatar
      Fix incompatbilities with MS-Windows 2000 and older · 86e45139
      Jussi Lahdenniemi authored
      * src/w32.c <multiByteToWideCharFlags>: New global variable.
      (filename_to_utf16, filename_from_ansi, check_windows_init_file):
      Use it instead of the literal MB_ERR_INVALID_CHARS.
      (maybe_load_unicows_dll): Initialize multiByteToWideCharFlags as
      appropriate for the underlying OS version.  For details, see
      http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00835.html.
      * src/w32.h: Declare multiByteToWideCharFlags.
      * src/w32fns.c (Fx_file_dialog, Fw32_shell_execute)
      (add_tray_notification): Use multiByteToWideCharFlags instead of
      the literal MB_ERR_INVALID_CHARS.
      (_resetstkoflw_proc): New typedef.
      (w32_reset_stack_overflow_guard): Call _resetstkoflw via a
      pointer, as this function is absent in msvcrt.dll shipped with W2K
      and older systems.
      
      Copyright-paperwork-exempt: yes
      86e45139
  12. 15 Jan, 2016 1 commit
    • Eli Zaretskii's avatar
      Make 'random' seeds cryptographically secure if possible · 3ffe81e2
      Eli Zaretskii authored
      * configure.ac: Check for "/dev/urandom".
      
      * src/sysdep.c (init_random) [HAVE_DEV_URANDOM]: Read the stream
      for the seed from "/dev/urandom".
      [WINDOWSNT]: Obtain the stream for the seed from w32 APIs.
      * src/fns.c (Frandom): Update the doc string to indicate that
      system entropy is used when available.
      * src/w32.c: Include wincrypt.h.
      (w32_init_crypt_random, w32_init_random): New functions, use the
      CryptGenRandom API.
      (globals_of_w32): Initialize w32_crypto_hprov handle to zero.
      * src/w32.h (w32_init_random): Add prototype.
      
      * doc/lispref/numbers.texi (Random Numbers): Document more details
      about 't' as the argument to 'random'.
      
      * etc/NEWS: Mention that '(random t)' now uses a cryptographically
      strong seed if possible.
      
      (Bug#22202)
      3ffe81e2
  13. 01 Jan, 2016 1 commit
  14. 26 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix compiler warnings in w32.c · 6f5f62b3
      Eli Zaretskii authored
      * src/w32.c (sys_socket): In case of error, use -1 as return
      value, not INVALID_SOCKET, which causes compiler warnings.
      (maybe_load_unicows_dll): Cast the return value of GetProcAddress
      to the appropriate function signature, to avoid compiler errors.
      Reported by Andy Moreton <andrewjmoreton@gmail.com>.  (Bug#21953)
      6f5f62b3
  15. 02 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix the MS-Windows build · 470e3028
      Eli Zaretskii authored
      * src/thread.h [WINDOWSNT]: Include sys/socket.h.
      
      * src/sysselect.h: Don't define fd_set and FD_* macros for
      MS-Windows here.
      * src/w32.h: Define them here.
      
      * src/process.h (sys_select): Declare prototype.
      
      * src/sysdep.c:
      * src/process.c:
      * src/filelock.c:
      * src/emacs.c:
      * src/callproc.c: Move inclusion of sys/select.h after lisp.h.
      * nt/inc/socket.h: Include w32.h instead of sysselect.h
      470e3028
  16. 31 Aug, 2015 1 commit
    • Eli Zaretskii's avatar
      Make file-accessible-directory-p reliable on MS-Windows · 697be62c
      Eli Zaretskii authored
      * src/w32.c (w32_accessible_directory_p): New function.
      * src/w32.h (w32_accessible_directory_p): Add prototype.
      * src/fileio.c (file_accessible_directory_p) [WINDOWSNT]: Call
      w32_accessible_directory_p to test a directory for accessibility
      by the current user.  (Bug#21346)
      (Ffile_accessible_directory_p): Remove the w32 specific caveat
      from the doc string.
      697be62c
  17. 30 Jul, 2015 1 commit
    • Eli Zaretskii's avatar
      Support long URLs in w32-shell-execute · f3f15aef
      Eli Zaretskii authored
      * src/w32fns.c (Fw32_shell_execute): Don't use filename_to_utf16
      and filename_to_ansi to convert the DOCUMENT argument, as it could
      be a URL that is not limited to MAX_PATH characters.  Instead, use
      MultiByteToWideChar directly, and allocate heap storage as
      required to accommodate the converted string.  Likewise with
      non-Unicode operation.  Ensure OPERATION is null-terminated, even
      if it is longer than 32K bytes.  (Bug#21158)
      f3f15aef
  18. 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
  19. 27 Mar, 2015 1 commit
    • Eli Zaretskii's avatar
      Support non-blocking connect on MS-Windows (Bug#20207) · d133cf83
      Eli Zaretskii authored
       Based on ideas from Kim F. Storm <storm@cua.dk>, see
       http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html.
      
       src/w32proc.c (reader_thread): If the FILE_CONNECT flag is set, call
       '_sys_wait_connect'.  If it returns STATUS_CONNECT_FAILED, exit
       the thread with code 2.
       (sys_select): Support 'wfds' in addition to 'rfds'.  If a
       descriptor in 'wfds' has its bit set, but the corresponding
       fd_info member doesn't have its FILE_CONNECT flag set, ignore the
       descriptor.  Otherwise, acknowledge a successful non-blocking
       connect by resetting the FILE_CONNECT flag and setting cp->status
       to STATUS_READ_ACKNOWLEDGED.
       src/w32.h (STATUS_CONNECT_FAILED): New enumeration value.
       (struct _child_process): New member 'errcode'.
       (FILE_CONNECT): New flag.
       (_sys_wait_connect): Add prototype.
       src/w32.c (pfn_WSAEnumNetworkEvents): New function pointer.
       (init_winsock): Load WSAEnumNetworkEvents from winsock DLL.
       (set_errno): Map WSAEWOULDBLOCK and WSAENOTCONN.
       (sys_connect): Support non-blocking 'connect' calls by setting the
       FILE_CONNECT flag in the fd_info member and returning EINPROGRESS.
       (_sys_read_ahead): Add debug message if this function is called
       for a descriptor that waits for a non-blocking connect to complete.
       (_sys_wait_connect): New function.
       (sys_read): Support STATUS_CONNECT_FAILED.  Return the error code
       recorded by _sys_wait_connect when the non-blocking connect
       failed.  Don't call WSAGetLastError before a call to set_errno had
       a chance to use its value, since WSAGetLastError clears the last
       error.
      
       nt/inc/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Don't define.
      d133cf83
  20. 05 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      MS-Windows followup to previous commit · 5b5dab12
      Eli Zaretskii authored
       src/w32proc.c, src/w32.h, src/w32fns.c, src/w32font.c, src/w32menu.c:
       src/w32notify.c, src/w32proc.c, src/w32select.c, src/w32term.c:
       src/w32uniscribe.c: Remove declarations of Q* variables that
       represent symbols.
      5b5dab12
  21. 01 Jan, 2015 2 commits
  22. 28 Dec, 2014 1 commit
    • Paul Eggert's avatar
      Wrap dll functions more simply · e092accb
      Paul Eggert authored
      * decompress.c, gnutls.c, image.c, xml.c:
      If WINDOWSNT, use '#define FOO fn_FOO' to wrap dll functions,
      rather than the inverse when not WINDOWSNT.  This isolates the
      fn_* business into the WINDOWSNT-specific section of the code,
      which makes it easier to maintain the generic code.
      * decompress.c (DEF_ZLIB_FN, LOAD_ZLIB_FN):
      * gnutls.c (DEF_GNUTLS_FN, LOAD_GNUTLS_FN):
      * image.c (DEF_IMGLIB_FN, LOAD_IMGLIB_FN):
      * xml.c (DEF_XML2_FN, LOAD_XML2_FN):
      Remove.  All uses replaced by DEF_DLL_FN.
      * w32.h (DEF_DLL_FN, LOAD_DLL_FN): New macros.
      e092accb
  23. 15 Sep, 2014 1 commit
    • Eli Zaretskii's avatar
      Support playing on MS-Windows non-ASCII sound files using Unicode APIs. · a7fc3ab8
      Eli Zaretskii authored
       src/sound.c [WINDOWSNT]: Include w32common.h and mbstring.h.
       (SOUND_WARNING) [WINDOWSNT]: Include in do..while and improve the
       error message format.  Use message_with_string to have non-ASCII
       file names properly displayed.
       (do_play_sound) [WINDOWSNT]: Use Unicode APIs to play sound files
       when w32-unicode-filenames is non-nil, but not on Windows 9X,
       where these APIs are not available even in UNICOWS.DLL.  Improve
       the format of error messages and include the file name in them
       where appropriate.
       (Fplay_sound_internal) [WINDOWSNT]: Make the MS-Windows branch
       call play-sound-functions, per documentation.
       src/w32.c (w32_get_long_filename, w32_get_short_filename): Constify
       the input file name arguments.
       src/w32.h (w32_get_long_filename, w32_get_short_filename): Update
       prototypes.
      a7fc3ab8
  24. 29 Aug, 2014 1 commit
    • Eli Zaretskii's avatar
      Implement case-insensitive and Unicode-compliant collation on MS-Windows. · 21ba51de
      Eli Zaretskii authored
       src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp): Doc fix.
       src/w32proc.c (w32_compare_strings): Accept additional argument
       IGNORE_CASE.  Set up the flags for CompareStringW to ignore case
       if requested.  If w32-collate-ignore-punctuation is non-nil, add
       NORM_IGNORESYMBOLS to the flags.
       (LINGUISTIC_IGNORECASE): Define if not already defined.
       (syms_of_ntproc) <Vw32_collate_ignore_punctuation>: New variable.
       src/sysdep.c (str_collate) [WINDOWSNT]: Adapt to the interface
       change.
       src/w32.h: Adjust prototype of w32_compare_strings.
      
       etc/NEWS: Mention w32-collate-ignore-punctuation.
      
      Fixes: debbugs:18051
      21ba51de
  25. 25 Aug, 2014 1 commit
    • Eli Zaretskii's avatar
      Implement locale-sensitive string collation for MS-Windows. (Bug#18051) · 015ea0ff
      Eli Zaretskii authored
       src/w32proc.c (get_lcid_callback, get_lcid, w32_compare_strings):
       New functions.
       src/w32.h (w32_compare_strings): Add prototype.
       src/w32.c <g_b_init_compare_string_w>: New global flag.
       (globals_of_w32): Initialize it.
       src/sysdep.c (str_collate) [WINDOWSNT]: Implementation for MS-Windows.
       src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp)
       [WINDOWSNT]: Call str_collate on MS-Windows.
      
       etc/NEWS: Mention that string-collate-* functions are supported on
       MS-Windows as well.
      015ea0ff
  26. 10 Jul, 2014 1 commit
  27. 06 Feb, 2014 1 commit
    • Eli Zaretskii's avatar
      Another fix for handling of file names on Windows 9X. · 829f4f22
      Eli Zaretskii authored
       src/w32.c (pMultiByteToWideChar, pWideCharToMultiByte): New
       variables: pointers through which to call the respective APIs.
       (filename_to_utf16, filename_from_utf16, filename_to_ansi)
       (filename_from_ansi, sys_link, check_windows_init_file): Call
       MultiByteToWideChar and WideCharToMultiByte through pointers.
       This is required on Windows 9X, where we dynamically load
       UNICOWS.DLL which has their non-stub implementations.
       (maybe_load_unicows_dll): Assign addresses to these 2 function
       pointers after loading UNICOWS.DLL.
       src/w32fns.c (Fx_file_dialog, Fw32_shell_execute) [!CYGWIN]: Call
       MultiByteToWideChar and WideCharToMultiByte through function
       pointers.
       src/w32.h (pMultiByteToWideChar, pWideCharToMultiByte): New
       declarations.
      829f4f22
  28. 18 Jan, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix file name handling on MS-Windows 9X. · 5197f0c2
      Eli Zaretskii authored
       src/w32.c (maybe_load_unicows_dll): New function.
       src/emacs.c (main) [WINDOWSNT]: Call maybe_load_unicows_dll early
       on, to make sure we can convert file names to and from UTF-8 on
       Windows 9X.  This fixes a failure to start up because Emacs cannot
       find term/w32-win.el.  Reported by oslsachem <oslsachem@gmail.com>.
       src/w32font.c [WINDOWSNT]: Include w32.h.
       (w32_load_unicows_or_gdi32): Call maybe_load_unicows_dll, instead
       of implementing the same stuff.
       Remove now unused g_b_init_is_windows_9x.
       src/w32.h (maybe_load_unicows_dll): Add prototype.
      
       nt/runemacs.c (ensure_unicows_dll): Don't tell in the message box
       that "emacs -nw" can do without UNICOWS.DLL on Windows 9X.  See
       w32.c:maybe_load_unicows_dll and its callers for the reason.
      5197f0c2
  29. 01 Jan, 2014 1 commit
  30. 14 Dec, 2013 1 commit
    • Eli Zaretskii's avatar
      Fix copy-file on MS-Windows with file names outside of current locale. · ec4440cf
      Eli Zaretskii authored
       src/fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the
       Windows-specific code to w32.c.  Change error message text to
       match that of Posix platforms.
       src/w32.c (w32_copy_file): New function, most of the code copied and
       reworked from Fcopy_file.  Improve error handling.  Plug memory
       leak when errors are thrown.  Support file names outside of the
       current codepage.  (Bug#7100)
      ec4440cf
  31. 03 Dec, 2013 1 commit
  32. 23 Nov, 2013 1 commit
  33. 16 Nov, 2013 1 commit
  34. 02 Nov, 2013 1 commit
  35. 26 Oct, 2013 1 commit
  36. 29 Aug, 2013 1 commit
    • Eli Zaretskii's avatar
      A possible fix for bug #14333 with hanging at exit on MS-Windows. · 3f940c5a
      Eli Zaretskii authored
       src/w32.c (term_winsock): Call release_listen_threads before calling
       WSACleanup.
       (_sys_wait_accept): Wait for accept event in a loop with a finite
       timeout, instead of waiting indefinitely.  Will hopefully avoid
       hanging during exit because WSACleanup deadlocks waiting for the
       event object to be released.
       src/w32proc.c (release_listen_threads): New function, signals all
       the reader threads that listen for connections to stop waiting.
       src/w32.h (release_listen_threads): Add prototype.
      3f940c5a
  37. 26 Aug, 2013 1 commit
    • Eli Zaretskii's avatar
      Fix MS-Windows build. · 6e9fb70c
      Eli Zaretskii authored
       src/callproc.c: 
       src/emacs.c: 
       src/filelock.c: 
       src/process.c: 
       src/sysdep.c: 
       src/w32.c: Reshuffle Windows-specific headers to avoid errors with
       redefinition of fd_set etc.
       src/process.c: Don't use num_pending_connects when
       NON_BLOCKING_CONNECT is not defined.
       src/sysselect.h: Move definitions of FD_* macros and of SELECT_TYPE
       here from w32.h.
       src/w32proc.c (sys_select): Adjust the argument types to what
       thread.h expects.
      
       nt/inc/sys/socket.h: Include stdint.h.  Include sysselect.h instead
       of w32.h.
      6e9fb70c
  38. 07 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Make file descriptors close-on-exec when possible. · 067428c1
      Paul Eggert authored
      This simplifies Emacs a bit, since it no longer needs to worry
      about closing file descriptors by hand in some cases.
      It also fixes some unlikely races.  Not all such races, as
      libraries often open files internally without setting
      close-on-exec, but it's an improvement.
      * admin/merge-gnulib (GNULIB_MODULES): Add fcntl, pipe2.
      (GNULIB_TOOL_FLAGS): Avoid binary-io, close.  Do not avoid fcntl.
      * configure.ac (mkostemp): New function to check for.
      (PTY_OPEN): Pass O_CLOEXEC to posix_openpt.
      * lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4:
      * m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * nt/gnulib.mk: Remove empty gl_GNULIB_ENABLED_verify section;
      otherwise, gnulib-tool complains given close-on-exec changes.
      * nt/inc/ms-w32.h (pipe): Remove.
      * nt/mingw-cfg.site (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec)
      (gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): New vars.
      * src/alloc.c (valid_pointer_p) [!WINDOWSNT]:
      * src/callproc.c (Fcall_process) [!MSDOS]:
      * src/emacs.c (main) [!DOS_NT]:
      * src/nsterm.m (ns_term_init):
      * src/process.c (create_process):
      Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
      * src/emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
      * src/filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
      Prefer mkostemp with O_CLOEXEC to mkstemp.
      * src/callproc.c (relocate_fd) [!WINDOWSNT]:
      * src/emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
      No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
      now using pipe2.
      * src/filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
      Make the resulting file descriptor close-on-exec.
      * src/lisp.h, src/lread.c, src/process.c (close_load_descs, close_process_descs):
      * src/lread.c (load_descriptor_list, load_descriptor_unwind):
      Remove; no longer needed.  All uses removed.
      * src/process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
      (close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
      New functions.
      (socket) [!SOCK_CLOEXEC]: Supply a substitute.
      (Fmake_network_process, Fnetwork_interface_list):
      (Fnetwork_interface_info, server_accept_connection):
      Make newly-created socket close-on-exec.
      * src/sysdep.c (emacs_open, emacs_fopen):
      Make new-created descriptor close-on-exec.
      * src/w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
      * src/w32.c, src/w32.h (pipe2): Rename from 'pipe', with new flags arg.
      
      Fixes: debbugs:14803
      067428c1
  39. 05 Mar, 2013 1 commit
    • Paul Eggert's avatar
      FILE's lock is now always .#FILE and may be a regular file. · 70743157
      Paul Eggert authored
      * etc/NEWS: Document this.
      * nt/inc/unistd.h (O_NOFOLLOW): New macro.
      * src/filelock.c: Include <c-ctype.h>.
      (MAX_LFINFO): New top-level constant.
      (lock_info_type): Remove members pid, boot_time.  Add members at,
      dot, colon.  Change user member to be the entire buffer, not a
      pointer.  This allows us to handle the case where a foreign
      pid or boot time exceeds the local range.  All uses changed.
      (LINKS_MIGHT_NOT_WORK): New constant.
      (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
      (defined_WINDOWSNT): Remove.
      (MAKE_LOCK_NAME, file_in_lock_file_name):
      Always use .#FILE (not .#-FILE) for the file lock,
      even if it is a regular file.
      (rename_lock_file): New function.
      (create_lock_file): Use it.
      (create_lock_file, read_lock_data):
      Prefer a symbolic link for the lock file, falling back on a
      regular file if symlinks don't work.  Do not try to create
      symlinks on MS-Windows, due to security hassles.  Stick with
      POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
      link, rename, unlink, mkstemp) when creating locks, as a GNUish
      host may be using a Windowsish file system, and cannot use
      MS-Windows-only system calls.  Fall back on mktemp if mkstemp
      doesn't work.  Don't fail merely because of a symlink-contents
      length limit in the current file system; fall back on regular
      files.  Increase the symlink contents length limit to 8 KiB, this
      should be big enough for any real use and doesn't crunch the
      stack.
      (create_lock_file, lock_file_1, read_lock_data):
      Simplify allocation of lock file buffers now that they fit in 8 KiB.
      (lock_file_1): Return error number, not bool.  All callers changed.
      (ELOOP): New macro, if not already defined.
      (read_lock_data): Return size of lock file contents, not Lisp object.
      All callers changed.  Handle a race condition if some other process
      replaces a regular-file lock with a symlink lock or vice versa,
      while we're trying to read the lock.
      (current_lock_owner): Parse contents more carefully, to help avoid
      confusing a regular-file lock with some other application's use
      of the file.  Check for lock file contents being too long, or
      not parsing correctly.
      (current_lock_owner, lock_file):
      Allow foreign pid and boot times that exceed the local range.
      (current_lock_owner, lock_if_free, lock_file):
      Simplify allocation of lock file contents.
      * src/w32.c (sys_rename_replace): New function, containing most of
      the contents of the old sys_rename.
      (sys_rename): Use it.
      (fchmod): New dummy function.
      * src/w32.h (sys_rename_replace, fchmod): New decls.
      
      Fixes: debbugs:13807
      70743157