emacs-diffs
[Top][All Lists]
Advanced

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

master 1bd012c 1/2: Make remote file locks more robust. (Bug#49621)


From: Michael Albinus
Subject: master 1bd012c 1/2: Make remote file locks more robust. (Bug#49621)
Date: Sun, 18 Jul 2021 10:59:04 -0400 (EDT)

branch: master
commit 1bd012ce439382e1da49e711ac74ac0a07d05075
Author: Naofumi Yasufuku <naofumi@yasufuku.dev>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Make remote file locks more robust.  (Bug#49621)
    
    * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): Make file
    locks more robust.  (Bug#49621)
    
    Copyright-paperwork-exempt: yes
---
 lisp/net/tramp-sh.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e6bd42a..8b4c78f 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3249,7 +3249,7 @@ implementation will be used."
                     (format "File %s exists; overwrite anyway? " filename)))))
       (tramp-error v 'file-already-exists filename))
 
-    (let (file-locked
+    (let ((file-locked (eq (file-locked-p lockname) t))
          (uid (or (tramp-compat-file-attribute-user-id
                    (file-attributes filename 'integer))
                   (tramp-get-remote-uid v 'integer)))
@@ -3260,7 +3260,7 @@ implementation will be used."
       ;; Lock file.
       (when (and (not (auto-save-file-name-p (file-name-nondirectory 
filename)))
                 (file-remote-p lockname)
-                (not (eq (file-locked-p lockname) t)))
+                (not file-locked))
        (setq file-locked t)
        ;; `lock-file' exists since Emacs 28.1.
        (tramp-compat-funcall 'lock-file lockname))
@@ -3481,7 +3481,7 @@ implementation will be used."
           (tramp-set-file-uid-gid filename uid gid))
 
        ;; Unlock file.
-       (when (and file-locked (eq (file-locked-p lockname) t))
+       (when file-locked
          ;; `unlock-file' exists since Emacs 28.1.
          (tramp-compat-funcall 'unlock-file lockname))
 



reply via email to

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