summaryrefslogtreecommitdiff
path: root/lisp/net/tramp.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-10-31 16:48:15 +0100
committerMichael Albinus <michael.albinus@gmx.de>2022-10-31 16:48:15 +0100
commitb7a76f288cc9d3a962cd5790203dc89303e81c97 (patch)
tree3b3551659f37a5b922bdf4704e8b7cb5ccdbffc2 /lisp/net/tramp.el
parent3b555dc91d21476fa4384f17188661ef2bd3c4e5 (diff)
downloademacs-b7a76f288cc9d3a962cd5790203dc89303e81c97.tar.gz
Fix tramp-handle-file-newer-than-file-p
* lisp/net/tramp.el (tramp-handle-file-newer-than-file-p): Don't use fractions of seconds. (Bug#58842)
Diffstat (limited to 'lisp/net/tramp.el')
-rw-r--r--lisp/net/tramp.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 63f313dc509..9552e51c48d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3997,6 +3997,17 @@ Let-bind it when necessary.")
(cond
((not (file-exists-p file1)) nil)
((not (file-exists-p file2)) t)
+ ;; Tramp reads and writes timestamps on second level. So we round
+ ;; the timestamps to seconds w/o fractions.
+ ;; `time-convert' has been introduced with Emacs 27.1.
+ ((fboundp 'time-convert)
+ (time-less-p
+ (tramp-compat-funcall
+ 'time-convert
+ (file-attribute-modification-time (file-attributes file2)) 'integer)
+ (tramp-compat-funcall
+ 'time-convert
+ (file-attribute-modification-time (file-attributes file1)) 'integer)))
(t (time-less-p
(file-attribute-modification-time (file-attributes file2))
(file-attribute-modification-time (file-attributes file1))))))