emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 579b0c0: Don't use LOCKNAME for temp files in Tramp (Bug#49406)


From: Michael Albinus
Subject: master 579b0c0: Don't use LOCKNAME for temp files in Tramp (Bug#49406)
Date: Mon, 5 Jul 2021 06:09:36 -0400 (EDT)

branch: master
commit 579b0c006e407aef1623f3b42d28b666426406c7
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Don't use LOCKNAME for temp files in Tramp (Bug#49406)
    
    * lisp/net/tramp.el (tramp-handle-write-region):
    * lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
    * lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
    * lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
    * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-write-region):
    Don't use LOCKNAME for temp file.  (Bug#49406)
    
    * test/lisp/shadowfile-tests.el (password-cache-expiry):
    Set `shadow-debug' also on emba.
---
 lisp/net/tramp-adb.el         | 4 ++--
 lisp/net/tramp-sh.el          | 6 +++---
 lisp/net/tramp-smb.el         | 5 ++---
 lisp/net/tramp-sshfs.el       | 4 ++--
 lisp/net/tramp.el             | 4 ++--
 test/lisp/shadowfile-tests.el | 2 +-
 6 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 7fb0ff5..f956952 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -533,7 +533,7 @@ But handle the case, if the \"test\" command is not 
available."
                       rw-path)))))))
 
 (defun tramp-adb-handle-write-region
-  (start end filename &optional append visit lockname mustbenew)
+  (start end filename &optional append visit _lockname mustbenew)
   "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
@@ -549,7 +549,7 @@ But handle the case, if the \"test\" command is not 
available."
       (when (and append (file-exists-p filename))
        (copy-file filename tmpfile 'ok)
        (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600)))
-      (write-region start end tmpfile append 'no-message lockname)
+      (write-region start end tmpfile append 'no-message)
       (with-tramp-progress-reporter
         v 3 (format-message
              "Moving tmp file `%s' to `%s'" tmpfile filename)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 88caa2f..5f597ff 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3233,7 +3233,7 @@ implementation will be used."
       tmpfile)))
 
 (defun tramp-sh-handle-write-region
-  (start end filename &optional append visit lockname mustbenew)
+  (start end filename &optional append visit _lockname mustbenew)
   "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
@@ -3260,7 +3260,7 @@ implementation will be used."
                  (or (file-directory-p localname)
                      (file-writable-p localname)))))
          ;; Short track: if we are on the local host, we can run directly.
-         (write-region start end localname append 'no-message lockname)
+         (write-region start end localname append 'no-message)
 
        (let* ((modes (tramp-default-file-modes
                       filename (and (eq mustbenew 'excl) 'nofollow)))
@@ -3296,7 +3296,7 @@ implementation will be used."
          (let ((file-coding-system-alist
                 (tramp-find-file-name-coding-system-alist filename tmpfile)))
            (condition-case err
-               (write-region start end tmpfile append 'no-message lockname)
+               (write-region start end tmpfile append 'no-message)
              ((error quit)
               (setq tramp-temp-buffer-file-name nil)
               (delete-file tmpfile)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 6fbf088..13edf16 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1573,7 +1573,7 @@ errors for shares like \"C$/\", which are common in 
Microsoft Windows."
       (error filename))))
 
 (defun tramp-smb-handle-write-region
-  (start end filename &optional append visit lockname mustbenew)
+  (start end filename &optional append visit _lockname mustbenew)
   "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
@@ -1591,8 +1591,7 @@ errors for shares like \"C$/\", which are common in 
Microsoft Windows."
       ;; We say `no-message' here because we don't want the visited file
       ;; modtime data to be clobbered from the temp file.  We call
       ;; `set-visited-file-modtime' ourselves later on.
-      (tramp-run-real-handler
-       #'write-region (list start end tmpfile append 'no-message lockname))
+      (write-region start end tmpfile append 'no-message)
 
       (with-tramp-progress-reporter
          v 3 (format "Moving tmp file %s to %s" tmpfile filename)
diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el
index c4a36fe..cac8c40 100644
--- a/lisp/net/tramp-sshfs.el
+++ b/lisp/net/tramp-sshfs.el
@@ -279,7 +279,7 @@ arguments to pass to the OPERATION."
        (tramp-fuse-local-file-name filename) mode flag))))
 
 (defun tramp-sshfs-handle-write-region
-  (start end filename &optional append visit lockname mustbenew)
+  (start end filename &optional append visit _lockname mustbenew)
   "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
@@ -291,7 +291,7 @@ arguments to pass to the OPERATION."
       (tramp-error v 'file-already-exists filename))
 
     (write-region
-     start end (tramp-fuse-local-file-name filename) append 'nomessage 
lockname)
+     start end (tramp-fuse-local-file-name filename) append 'nomessage)
     (tramp-flush-file-properties v localname)
 
     ;; The end.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 75e4455..04ec06d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4355,7 +4355,7 @@ of."
           (t (tramp-compat-time-equal-p mt tramp-time-doesnt-exist))))))))
 
 (defun tramp-handle-write-region
-  (start end filename &optional append visit lockname mustbenew)
+  (start end filename &optional append visit _lockname mustbenew)
   "Like `write-region' for Tramp files."
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
@@ -4386,7 +4386,7 @@ of."
       ;; We say `no-message' here because we don't want the visited file
       ;; modtime data to be clobbered from the temp file.  We call
       ;; `set-visited-file-modtime' ourselves later on.
-      (write-region start end tmpfile append 'no-message lockname)
+      (write-region start end tmpfile append 'no-message)
       (condition-case nil
          (rename-file tmpfile filename 'ok-if-already-exists)
        (error
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 7c9d05a..84a9479 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -70,7 +70,7 @@
   "Temporary directory for Tramp tests.")
 
 (setq password-cache-expiry nil
-      shadow-debug (getenv "EMACS_HYDRA_CI")
+      shadow-debug (or (getenv "EMACS_HYDRA_CI") (getenv "EMACS_EMBA_CI"))
       tramp-verbose 0
       ;; When the remote user id is 0, Tramp refuses unsafe temporary files.
       tramp-allow-unsafe-temporary-files



reply via email to

[Prev in Thread] Current Thread [Next in Thread]