summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-smb.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-01-15 10:18:45 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2019-01-15 10:21:09 -0800
commit9fc02ff5ea95c31a8d81eabb5634aa135fcd8786 (patch)
treec6a8b2db65efc5b51a184658a0672f89b625015e /lisp/net/tramp-smb.el
parent223e7b87872d4a010ae1c9a6f09a9c15aee46692 (diff)
downloademacs-9fc02ff5ea95c31a8d81eabb5634aa135fcd8786.tar.gz
emacs-9fc02ff5ea95c31a8d81eabb5634aa135fcd8786.tar.bz2
emacs-9fc02ff5ea95c31a8d81eabb5634aa135fcd8786.zip
Fix accept-process-output/process-live-p confusion
* doc/lispref/processes.texi (Accepting Output): Document the issue. * lisp/net/tramp-adb.el (tramp-adb-parse-device-names): * lisp/net/tramp-rclone.el (tramp-rclone-parse-device-names): * lisp/net/tramp-smb.el (tramp-smb-wait-for-output): * lisp/net/tramp.el (tramp-interrupt-process): * test/src/process-tests.el (make-process/mix-stderr): Fix code that uses accept-process-output and process-live-p. Add FIXME comments as necessary. * lisp/net/tramp-sudoedit.el (tramp-sudoedit-action-sudo): * lisp/net/tramp.el (tramp-action-out-of-band): Add FIXME comments as necessary.
Diffstat (limited to 'lisp/net/tramp-smb.el')
-rw-r--r--lisp/net/tramp-smb.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 0c42a5d1a53..abf3248a353 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -2038,10 +2038,10 @@ Returns nil if an error message has appeared."
;; Algorithm: get waiting output. See if last line contains
;; `tramp-smb-prompt' sentinel or `tramp-smb-errors' strings.
;; If not, wait a bit and again get waiting output.
- (while (and (not found) (not err) (process-live-p p))
-
- ;; Accept pending output.
- (tramp-accept-process-output p 0.1)
+ ;; FIXME: Either remove " 0.1", or comment why it's needed.
+ (while (and (not found) (not err)
+ (or (tramp-accept-process-output p 0.1)
+ (process-live-p p)))
;; Search for prompt.
(goto-char (point-min))
@@ -2052,10 +2052,13 @@ Returns nil if an error message has appeared."
(setq err (re-search-forward tramp-smb-errors nil t)))
;; When the process is still alive, read pending output.
- (while (and (not found) (process-live-p p))
-
- ;; Accept pending output.
- (tramp-accept-process-output p 0.1)
+ ;; FIXME: This loop should be folded into the previous loop.
+ ;; Also, ERR should be set just once, after the combined
+ ;; loop has finished.
+ ;; FIXME: Either remove " 0.1", or comment why it's needed.
+ (while (and (not found)
+ (or (tramp-accept-process-output p 0.1)
+ (process-live-p p)))
;; Search for prompt.
(goto-char (point-min))