Fix some stat-related races.
* 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) : Remove unused code with stat race. * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]: Remove ineffective code with stat race.
Showing with 27 additions and 63 deletions