1. 19 Jan, 2013 3 commits
    • Paul Eggert's avatar
      Allow floating-point file offsets. · b3fbb395
      Paul Eggert authored
      Problem reported by Vitalie Spinu in
      <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
      * doc/lispref/files.texi (Reading from Files, Writing to Files):
      Say that file offsets can be numbers, not just integers.
      * src/fileio.c (emacs_lseek): Remove.
      (file_offset): New function.
      (Finsert_file_contents, Fwrite_region): Use it.
      b3fbb395
    • Paul Eggert's avatar
      Work around bug in CIFS and vboxsf file systems. · 9fe43ff6
      Paul Eggert authored
      The bug was observed on Ubuntu operating inside a virtual machine,
      editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
      The workaround introduces a race condition on non-buggy hosts,
      but it's an unlikely race and anyway there's a nearly identical
      nearby race that can't be fixed.
      * fileio.c (valid_timestamp_file_system, timestamp_file_system):
      New static vars.
      (Fwrite_region): Test for file system time stamp bug.
      (init_fileio): New function.
      * lisp.h (init_fileio): Declare it.
      * emacs.c (main): Call it.
      
      Fixes: debbugs:13149
      9fe43ff6
    • Paul Eggert's avatar
      * fileio.c (Finsert_file_contents): Simplify new diagnostic · fa705c99
      Paul Eggert authored
      and make it more consistent with other stat-failure diagnostics.
      fa705c99
  2. 18 Jan, 2013 2 commits
  3. 17 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      * lisp.h (toplevel): Add comment about using Lisp_Save_Value · 468afbac
      Dmitry Antipov authored
      objects, related functions and macros.
      (make_save_value): Adjust prototype.
      (make_save_pointer): New prototype.
      (SAFE_NALLOCA): Fix indentation.  Use make_save_pointer.
      (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
      * alloc.c (format_save_value): Rename to make_save_value.
      (make_save_pointer): New function.
      (record_xmalloc): Use make_save_pointer.
      * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
      * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
      Change users of make_save_value to make_save_pointer.
      Likewise for format_save_value and make_save_value.
      468afbac
  4. 15 Jan, 2013 2 commits
    • Dmitry Antipov's avatar
      * keymap.c (map_keymap_internal): Use format_save_value. · 3346c1d0
      Dmitry Antipov authored
      (map_keymap_char_table_item): Adjust accordingly.
      * fileio.c (non_regular_fd, non_regular_inserted)
      (non_regular_nbytes): Remove.
      (Finsert_file_contents): Convert trytry to ptrdiff_t.  Use
      format_save_value to pass parameters to read_non_regular.
      (read_non_regular): Use XSAVE_ macros to extract parameters.
      Adjust comment.
      * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
      format_save_value.
      (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
      3346c1d0
    • Dmitry Antipov's avatar
      * src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extraction · 2b30549c
      Dmitry Antipov authored
      from any Lisp_Save_Value slot.  Add type checking.
      * src/alloc.c, src/dired.c, src/editfns.c, src/fileio.c, src/ftfont.c:
      * src/gtkutil.c, src/keymap.c, src/lread.c, src/nsterm.h, src/nsmenu.c:
      * src/xfns.c, src/xmenu.c, src/xselect.c: All users changed.
      * admin/coccinelle/xsave.cocci: Semantic patch to adjust users of
      XSAVE_POINTER and XSAVE_INTEGER macros.
      2b30549c
  5. 14 Jan, 2013 2 commits
    • Paul Eggert's avatar
      Avoid needless casts with XSAVE_POINTER. · c50cf2ea
      Paul Eggert authored
      * alloc.c (mark_object) [GC_MARK_STACK]:
      * dired.c (directory_files_internal_unwind):
      * fileio.c (do_auto_save_unwind):
      * gtkutil.c (pop_down_dialog):
      * keymap.c (map_keymap_char_table_item):
      * lread.c (load_unwind):
      * nsmenu.m (pop_down_menu):
      * print.c (print_object) [GC_MARK_STACK]:
      * xfns.c (clean_up_file_dialog):
      * xmenu.c (cleanup_widget_value_tree):
      Omit casts between XSAVE_POINTER and a pointer type.
      c50cf2ea
    • Dmitry Antipov's avatar
      Make Lisp_Save_Value more versatile storage for up to four objects. · 73ebd38f
      Dmitry Antipov authored
      * lisp.h (toplevel): Enumeration to describe types of saved objects.
      (struct Lisp_Save_Value): New layout.  Adjust comments.
      (XSAVE_POINTER): New macro.
      (XSAVE_INTEGER): Likewise.
      (allocate_misc): Add prototype.
      (free_misc): Likewise.
      * alloc.c (allocate_misc): Now global.
      (free_misc): Likewise.  Adjust comment.
      (make_save_value): Use new Lisp_Save_Value layout.  Adjust comment.
      (free_save_value): Likewise.
      (mark_object): Likewise.
      * editfns.c (save_excursion_save): Pack everything within
      Lisp_Save_Value and so avoid xmalloc.
      (save_excursion_restore): Adjust to match new layout.  Use free_misc
      because we do not allocate extra memory any more.  Add eassert.
      * print.c (print_object): New code to print Lisp_Save_Value.  Do not
      rely on valid_lisp_object_p if !GC_MARK_STACK.  Adjust comments.
      * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
      * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
      Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
      73ebd38f
  6. 04 Jan, 2013 1 commit
  7. 01 Jan, 2013 1 commit
  8. 29 Dec, 2012 3 commits
  9. 24 Dec, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #13262 with crashes in completion on MS-Windows with non-ASCII filenames. · f5c81c80
      Eli Zaretskii authored
       src/fileio.c (file_name_as_directory, directory_file_name): Accept
       an additional argument MULTIBYTE to indicate whether the input C
       came from a multibyte or a unibyte Lisp string; all callers
       adjusted.  Don't assume the input string is always multibyte.
       (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
       don't ENCODE_FILE them, and return a unibyte string if the input
       was unibyte.
       (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
       don't assume the input strings will always be multibyte.  If the
       input strings are multibyte, decode strings obtained from C
       library functions.
      f5c81c80
  10. 21 Dec, 2012 1 commit
  11. 20 Dec, 2012 1 commit
    • Dmitry Antipov's avatar
      Avoid calls to CHAR_TO_BYTE if byte position is known. · 13002885
      Dmitry Antipov authored
      * editfns.c (make_buffer_string_both): Use move_gap_both.
      (Fbuffer_string): Use make_buffer_string_both.
      * marker.c (buf_charpos_to_bytepos): Convert to eassert.
      Adjust comment.
      (buf_bytepos_to_charpos): Likewise.
      (charpos_to_bytepos): Remove.
      * fileio.c (Finsert_file_contents): Use move_gap_both.
      * search.c (Freplace_match): Likewise.
      * process.c (process_send_region): Likewise. Use convenient
      names for byte positions.
      * lisp.h (charpos_to_bytepos): Remove prototype.
      * indent.c (scan_for_column): Use CHAR_TO_BYTE.
      * insdel.c (move_gap): Likewise.
      13002885
  12. 17 Dec, 2012 1 commit
    • Eli Zaretskii's avatar
      Support Posix ACL APIs on MS-Windows. · 66447e07
      Eli Zaretskii authored
       src/w32.c: Include sddl.h and sys/acl.h.
       (SDDL_REVISION_1): Define if not already defined.
       (g_b_init_get_security_descriptor_dacl)
       (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
       (g_b_init_is_valid_security_descriptor)
       (g_b_init_set_file_security): New static flags.
       (globals_of_w32): Initialize them to zero.
       (SetFileSecurity_Name): New string constant.
       (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
       (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
       (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
       (IsValidSecurityDescriptor_Proc): New typedefs.
       (get_file_security, get_security_descriptor_owner)
       (get_security_descriptor_group): Set errno to ENOTSUP.
       (set_file_security, get_security_descriptor_dacl)
       (is_valid_security_descriptor, convert_sd_to_sddl)
       (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
       (acl_free, acl_get_file, acl_set_file): New functions.
       src/fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
      
       nt/inc/sys/acl.h: New file.
       nt/inc/ms-w32.h (ENOTSUP): Define if undefined.
       nt/config.nt (HAVE_POSIX_ACL): Define.
      
       doc/lispref/files.texi (File Attributes, Changing Files): Update to include
       MS-Windows support for ACLs.
      66447e07
  13. 16 Dec, 2012 1 commit
    • Romain Francoise's avatar
      Add support for preserving ACL entries of files. · 7c3d167f
      Romain Francoise authored
      	* configure.ac (acl): New option.
      	(HAVE_POSIX_ACL): Test for POSIX ACL support.  This is typically
      	provided by libacl on GNU/Linux.
      
      	* fileio.c (Ffile_acl, Fset_file_acl): New functions.
      	(Fcopy_file): Change last arg to `preserve_extended_attributes'
      	and copy ACL entries of file in addition to SELinux context if
      	set.
      	(syms_of_fileio): Add `file-acl' and `set-file-acl'.
      
      	* Makefile.in (LIBACL_LIBS): New macro.
      	(LIBES): Use it.
      
      	* files.el (file-extended-attributes)
      	(set-file-extended-attributes): New functions.
      	(backup-buffer): Use them to handle both SELinux context and ACL
      	entries.
      	(backup-buffer-copy): Work with an alist of extended attributes,
      	rather than an SELinux context.
      	(basic-save-buffer-2): Ditto.
      
      	* files.texi (File Attributes): Document ACL support and new
      	`file-acl' function.
      	(Changing Files): Mention argument name change of `copy-file' and
      	document new function `set-file-acl'.
      7c3d167f
  14. 15 Dec, 2012 2 commits
    • Paul Eggert's avatar
      7d80ea23
    • Eli Zaretskii's avatar
      Fix bug #13079 on MS-Windows with temp files not being deleted. · b0728617
      Eli Zaretskii authored
       src/w32.h (_child_process): New members input_file and
       pending_deletion.
       (register_child): First argument is now pid_t.
       (record_infile, record_pending_deletion): New prototypes.
       src/w32proc.c (new_child): Initialize input_file and
       pending_deletion members of the child.
       (delete_child): Delete the child's temporary input file, if any,
       that is pending deletion.
       (register_child): First argument is now pid_t.
       (record_infile, record_pending_deletion): New functions.
       (reap_subprocess): Fix a typo in DebPrint string.
       (sys_spawnve, sys_kill): Use pid_t for PID arguments.
       src/fileio.c (internal_delete_file): Return an int again: non-zero
       if delete-file succeeds, zero otherwise.
       src/lisp.h (internal_delete_file): Adjust prototype.
       src/callproc.c (Fcall_process): Don't overwrite infile with result
       of DECODE_FILE.
       [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
       asynchronous subprocess, record the name of the input file name,
       if any.
       (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
       delete the file, record it as pending deletion when the subprocess
       exits.
      
       nt/inc/ms-w32.h (sys_unlink): Provide prototype.
      b0728617
  15. 13 Dec, 2012 2 commits
  16. 10 Dec, 2012 3 commits
  17. 04 Dec, 2012 1 commit
  18. 01 Dec, 2012 1 commit
  19. 27 Nov, 2012 2 commits
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for grp.h, pwd.h. · 350e0088
      Paul Eggert authored
      * dired.c (stat_uname, stat_gname):
      * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
      350e0088
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for errno.h. · 22626a85
      Paul Eggert authored
      * lib-src/movemail.c (main): Assume EAGAIN and EBUSY.
      * src/dired.c (directory_files_internal, file_name_completion):
      Assume EAGAIN and EINTR are defined.
      * src/fileio.c (Fcopy_file): Assume EISDIR is defined.
      * src/gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
      * src/gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
      * src/lread.c (readbyte_from_file): Assume EINTR is defined.
      * src/process.c (wait_reading_process_output, send_process) [subprocesses]:
      Assume EIO and EAGAIN are defined.
      * src/unexcoff.c (write_segment): Assume EFAULT is defined.
      
      Fixes: debbugs:12968
      22626a85
  20. 21 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for unistd.h. · 9239d970
      Paul Eggert authored
      * admin/CPP-DEFINES (BROKEN_GETWD, HAVE_GETCWD, HAVE_GETWD, HAVE_SIZE_T)
      (HAVE_UNISTD_H): Remove.
      * configure.ac: Do not check for getcwd or getwd.
      * lib-src/emacsclient.c (getcwd): Remove decl.
      (get_current_dir_name): Assume getcwd exists.
      * lib-src/etags.c (HAVE_GETCWD): Remove.
      (getcwd): Remove decl.
      (NO_LONG_OPTIONS): Remove this.  All uses removed.
      Emacs always has GNU getopt.
      (etags_getcwd): Assume getcwd exists.
      * lib-src/movemail.c (F_OK, X_OK, W_OK, R_OK): Remove.
      * nt/config.nt (HAVE_GETCWD): Remove.
      * src/alloc.c: Assume unistd.h exists.
      * src/fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
      * src/sysdep.c (get_current_dir_name): Assume getcwd exists.
      (getwd) [USG]: Remove; no longer needed.
      (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
      * src/w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
      * src/w32.h (getcwd): Remove decl.
      
      Fixes: debbugs:12945
      9239d970
  21. 18 Nov, 2012 1 commit
  22. 14 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Use faccessat, not access, when checking file permissions. · 73dcdb9f
      Paul Eggert authored
      This fixes a bug that has been present in Emacs since its creation.
      It was reported by Chris Torek in 1983 even before GNU Emacs existed,
      which must set some sort of record.  (Torek's bug report was against
      a predecessor of GNU Emacs, but GNU Emacs happened to have the
      same common flaw.)  See Torek's Usenet posting
      "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
      Posted: Fri Apr  8 14:18:56 1983.
      * .bzrignore: Add lib/fcntl.h.
      * configure.ac (euidaccess): Remove check; gnulib does this for us now.
      (gl_FCNTL_O_FLAGS): Define a dummy version.
      * lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h:
      * lib/getgroups.c, lib/group-member.c, lib/root-uid.h:
      * lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4:
      * m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4:
      New files, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * admin/merge-gnulib (GNULIB_MODULES): Add faccessat.
      (GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix,
      openat-die, openat-h, save-cwd.  Do not avoid fcntl-h.
      Omit gnulib's m4/fcntl-o.m4.
      * nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols.
      (access): Remove.
      (faccessat): New macro.
      * src/Makefile.in (LIB_EACCESS): New macro.
      (LIBES): Use it.
      * src/callproc.c (init_callproc):
      * src/charset.c (init_charset):
      * src/fileio.c (check_existing, check_executable, check_writable)
      (Ffile_readable_p):
      * src/lread.c (openp, load_path_check):
      * src/process.c (allocate_pty):
      * src/xrdb.c (file_p):
      Use effective UID when checking permissions, not real UID.
      * src/callproc.c (init_callproc):
      * src/charset.c (init_charset):
      * src/lread.c (load_path_check, init_lread):
      Test whether directories are accessible, not merely whether they exist.
      * src/conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
      * src/fileio.c (check_existing, check_executable, check_writable)
      (Ffile_readable_p):
      Use symbolic names instead of integers for the flags, as they're
      portable now.
      (check_writable): New arg AMODE.  All uses changed.
      Set errno on failure.
      (Ffile_readable_p): Use faccessat, not stat + open + close.
      (Ffile_writable_p): No need to call check_existing + check_writable.
      Just call check_writable and then look at errno.  This saves a syscall.
      dir should never be nil; replace an unnecessary runtime check
      with an eassert.  When checking the parent directory of a nonexistent
      file, check that the directory is searchable as well as writable, as
      we can't create files in unsearchable directories.
      (file_directory_p): New function, which uses 'stat' on most platforms
      but faccessat with D_OK (for efficiency) if WINDOWSNT.
      (Ffile_directory_p, Fset_file_times): Use it.
      (file_accessible_directory_p): New function, which uses a single
      syscall for efficiency.
      (Ffile_accessible_directory_p): Use it.
      * src/xrdb.c (file_p): Use file_directory_p.
      * src/lisp.h (file_directory_p, file_accessible_directory_p): New decls.
      * src/lread.c (openp): When opening a file, use fstat rather than
      stat, as that avoids a permissions race.  When not opening a file,
      use file_directory_p rather than stat.
      (dir_warning): First arg is now a usage string, not a format.
      Use errno.  All uses changed.
      * src/nsterm.m (ns_term_init): Remove unnecessary call to file-readable
      that merely introduced a race.
      * src/process.c, src/sysdep.c, src/term.c: All uses of '#ifdef O_NONBLOCK'
      changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
      and similarly for the other O_* flags.
      * src/w32.c (sys_faccessat): Rename from sys_access and switch to
      faccessat's API.  All uses changed.
      * src/xrdb.c: Do not include <sys/stat.h>; no longer needed.
      (magic_db): Rename from magic_file_p.
      (magic_db, search_magic_path): Return an XrmDatabase rather than a
      char *, so that we don't have to test for file existence
      separately from opening the file for reading.  This removes a race
      fixes a permission-checking problem, and simplifies the code.
      All uses changed.
      (file_p): Remove; no longer needed.
      
      Fixes: debbugs:12632
      73dcdb9f
  23. 13 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Fix a race with verify-visited-file-modtime. · b95a9c0c
      Paul Eggert authored
      Since at least 1991 Emacs has ignored an mtime difference of no
      more than one second, but my guess is that this was to work around
      file system bugs that were fixed long ago.  Since the race is
      causing problems now, let's remove that code.
      * fileio.c (Fverify_visited_file_modtime): Do not accept a file
      whose time stamp is off by no more than a second.  Insist that the
      file time stamps match exactly.
      
      Fixes: debbugs:12863
      b95a9c0c
  24. 19 Oct, 2012 2 commits
    • Paul Eggert's avatar
      Undo faccessat change. · f0a80175
      Paul Eggert authored
      f0a80175
    • Paul Eggert's avatar
      Use faccessat, not access, when checking file permissions. · e752e0b0
      Paul Eggert authored
      * .bzrignore: Add lib/fcntl.h.
      * configure.ac (euidaccess): Remove check; gnulib does this for us now.
      (gl_FCNTL_O_FLAGS): Define a dummy version.
      * lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h:
      * lib/getgroups.c, lib/group-member.c, lib/root-uid.h:
      * lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4:
      * m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4:
      New files, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * admin/merge-gnulib (GNULIB_MODULES): Add faccessat.
      (GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix,
      openat-die, openat-h, save-cwd.  Do not avoid fcntl-h.
      Omit gnulib's m4/fcntl-o.m4.
      * nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols.
      (access): Remove.
      (faccessat): New macro.
      * src/Makefile.in (LIB_EACCESS): New macro.
      (LIBES): Use it.
      * src/callproc.c (init_callproc):
      * src/charset.c (init_charset):
      * src/fileio.c (check_existing, check_executable):
      * src/lread.c (openp, load_path_check):
      * src/process.c (allocate_pty):
      * src/xrdb.c (file_p):
      Use faccessat, not access or euidaccess.  Use symbolic names
      instead of integers for the flags, as they're portable now.
      * src/charset.c, src/xrdb.c: Include <fcntl.h>, for the new flags used.
      * src/fileio.c (Ffile_readable_p):
      Use faccessat, not stat + open + close.
      (file_directory_p): New function, which uses 'stat' on most places
      but 'access' (for efficiency) if WINDOWSNT.
      * src/fileio.c (Ffile_directory_p, Fset_file_times):
      * src/xrdb.c (file_p): Use file_directory_p.
      * src/lisp.h (file_directory_p): New decl.
      * src/lread.c (openp): When opening a file, use fstat rather than
      stat, as that avoids a permissions race.  When not opening a file,
      use file_directory_p rather than stat.
      * src/process.c, src/sysdep.c, src/term.c: All uses of '#ifdef O_NONBLOCK'
      changed to '#if O_NONBLOCK', to accommodate gnulib O_* tyle.
      * src/w32.c (sys_faccessat): Rename from sys_access and switch to
      faccessat's API.  All uses changed.
      
      Fixes: debbugs:12632
      e752e0b0
  25. 17 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix warnings when compiling on MS-Windows with -std=gnu99. · a68089e4
      Eli Zaretskii authored
       src/makefile.w32-in ($(BLD)/w32.$(O)): 
       ($(BLD)/vm-limit.$(O)): 
       ($(BLD)/term.$(O)): 
       ($(BLD)/unexw32.$(O)): 
       ($(BLD)/fileio.$(O)): 
       ($(BLD)/dispnew.$(O)): Update dependencies.
       src/w32term.h (w32_initialize_display_info, initialize_w32_display):
       Add prototypes.
       src/w32proc.c: Include ctype.h.
       src/w32.h (init_environment, check_windows_init_file)
       (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
       (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
       (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
       (sys_link): Add prototypes.
       src/w32.c: Include w32select.h.
       (sys_access, e_malloc, sys_select): Add prototypes.
       (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
       src/vm-limit.c [WINDOWSNT]: Include w32heap.h.
       src/unexw32.c: Include lisp.h and w32.h.
       src/term.c [WINDOWSNT]: Include w32term.h.
       src/process.c [WINDOWSNT]: Add prototype of sys_select.
       src/fileio.c [WINDOWSNT]: Include w32.h.
       src/dispnew.c [WINDOWSNT]: Include w32.h.
      
       nt/inc/pwd.h (getuid, geteuid): Add prototypes.
       nt/inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r)
       (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask)
       (pthread_sigmask, sigismember, setpgrp, sigaction, alarm)
       (sys_kill, getpagesize): Add prototypes for emulated functions.
       nt/inc/grp.h (getgid, getegid): Add prototypes.
       nt/gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99.
       nt/configure.bat (chkapiN): Avoid compiler warning in junk.c when
       compiling with -std=gnu99.
       nt/config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it
       could be used via --cflags switch to configure.bat.
      a68089e4
  26. 13 Oct, 2012 2 commits
    • Andreas Schwab's avatar
      * fileio.c: Formatting fixes. · ce2fe65a
      Andreas Schwab authored
      ce2fe65a
    • Paul Eggert's avatar
      Fix some stat-related races. · d6453ce4
      Paul Eggert authored
      * fileio.c (Fwrite_region): Avoid race condition if a file is
      removed or renamed by some other process immediately after Emacs
      writes it but before Emacs stats it.  Do not assume that stat (or
      fstat) succeeds.
      * image.c (slurp_file): Resolve the file name with fopen + fstat
      rather than stat + fopen.
      (pbm_read_file) [0]: Remove unused code with stat race.
      * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
      Remove ineffective code with stat race.
      d6453ce4