unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 28023@debbugs.gnu.org
Subject: bug#28023: fix make-temp-file race on local host
Date: Sat, 12 Aug 2017 08:55:31 -0700	[thread overview]
Message-ID: <dc65ecbc-1e9c-40c3-6fb6-e99ee129cce7@cs.ucla.edu> (raw)
In-Reply-To: <877ey9dqfl.fsf@detlef>

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

Michael Albinus wrote:
> I've implemented this, commit ec5cfaa456.

Thanks. Unfortunately this caused "make check" to fail on Fedora 26. I installed 
the attached patch, which causes the test to pass. Can you please look over it 
to see whether it makes sense, and look for similar problems elsewhere? (I'm not 
that familiar with Tramp.) Thanks.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Adjust-jka-compr-to-recent-Tramp-changes.patch --]
[-- Type: text/x-patch; name="0001-Adjust-jka-compr-to-recent-Tramp-changes.patch", Size: 1703 bytes --]

From bbf52c142afbb9e10bf2ae20b3c77993fda26b43 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 12 Aug 2017 08:52:25 -0700
Subject: [PATCH] Adjust jka-compr to recent Tramp changes.

* lisp/jka-compr.el (jka-compr-write-region):
Two new args LOCKNAME and MUSTBENEW.
---
 lisp/jka-compr.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 26a7cf5..9e780f8 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -252,7 +252,8 @@ jka-compr-make-temp-name
   "This routine will return the name of a new file."
   (make-temp-file jka-compr-temp-name-template))
 
-(defun jka-compr-write-region (start end file &optional append visit)
+(defun jka-compr-write-region (start end file &optional
+                                     append visit lockname mustbenew)
   (let* ((filename (expand-file-name file))
 	 (visit-file (if (stringp visit) (expand-file-name visit) filename))
 	 (info (jka-compr-get-compression-info visit-file))
@@ -334,7 +335,8 @@ jka-compr-write-region
 	      (jka-compr-run-real-handler 'write-region
 					  (list (point-min) (point-max)
 						filename
-						(and append can-append) 'dont))
+						(and append can-append) 'dont
+						lockname mustbenew))
 	      (erase-buffer)) )
 
 	  (delete-file temp-file)
@@ -365,7 +367,8 @@ jka-compr-write-region
 	  nil)
 
       (jka-compr-run-real-handler 'write-region
-				  (list start end filename append visit)))))
+				  (list start end filename append visit
+					lockname mustbenew)))))
 
 
 (defun jka-compr-insert-file-contents (file &optional visit beg end replace)
-- 
2.7.4


  reply	other threads:[~2017-08-12 15:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  5:38 bug#28023: fix make-temp-file race on local host Paul Eggert
2017-08-09  6:51 ` Michael Albinus
2017-08-09  9:22   ` Paul Eggert
2017-08-09 11:21     ` Michael Albinus
2017-08-13  7:21       ` Paul Eggert
2017-08-12 10:35     ` Michael Albinus
2017-08-12 15:55       ` Paul Eggert [this message]
2017-08-12 16:09         ` Eli Zaretskii
2017-08-12 16:25           ` Paul Eggert
2017-08-12 16:52             ` Eli Zaretskii
2017-08-12 17:57               ` Paul Eggert
2017-08-12 18:07                 ` Eli Zaretskii
2017-08-12 17:51         ` Michael Albinus
2017-08-09 16:05 ` Eli Zaretskii
2017-08-09 18:47   ` Paul Eggert
2017-08-09 19:09     ` Eli Zaretskii
2017-08-09 23:36       ` Paul Eggert
2017-08-10 15:35         ` Eli Zaretskii
2017-08-10 22:24           ` Paul Eggert
2017-08-11  6:21             ` Eli Zaretskii
2017-08-11  7:44               ` Paul Eggert
2017-08-11  8:03                 ` Eli Zaretskii
2017-08-12  8:31                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc65ecbc-1e9c-40c3-6fb6-e99ee129cce7@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=28023@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).