Skip to content

Commit 7506cc4

Browse files
authored
[Fix clojure-emacs#3183] Fix time subtraction bug in nrepl-client (clojure-emacs#3184)
Port to future Emacs, and fix bug on current and older Emacs when the clock modulo 2**16 wraps around.
1 parent 3eff4f9 commit 7506cc4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: nrepl-client.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,9 @@ If TOOLING, use the tooling session rather than the standard session."
902902
(setq time0 (current-time)))
903903
;; break out in case we don't receive a response for a while
904904
(when (and nrepl-sync-request-timeout
905-
(> (cadr (time-subtract (current-time) time0))
906-
nrepl-sync-request-timeout))
905+
(time-less-p
906+
nrepl-sync-request-timeout
907+
(time-subtract nil time0)))
907908
(error "Sync nREPL request timed out %s" request)))
908909
;; Clean up the response, otherwise we might repeatedly ask for input.
909910
(nrepl-dict-put response "status" (remove "need-input" status))

0 commit comments

Comments
 (0)