Commit 2e0947ab authored by Michael Albinus's avatar Michael Albinus
Browse files

Notify broken file notification from Tramp

* lisp/net/tramp.el (tramp-file-notify-process-sentinel): New defun.

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Set process sentinel.
parent ebecafbd
Pipeline #1558 failed with stage
in 81 minutes and 19 seconds
......@@ -1187,6 +1187,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(process-put p 'adjust-window-size-function #'ignore)
(set-process-query-on-exit-flag p nil)
(set-process-filter p #'tramp-gvfs-monitor-process-filter)
(set-process-sentinel p #'tramp-file-notify-process-sentinel)
;; There might be an error if the monitor is not supported.
;; Give the filter a chance to read the output.
(while (tramp-accept-process-output p 0))
......
......@@ -3645,6 +3645,7 @@ Fall back to normal file name handler if no Tramp handler exists."
(process-put p 'watch-name localname)
(set-process-query-on-exit-flag p nil)
(set-process-filter p filter)
(set-process-sentinel p #'tramp-file-notify-process-sentinel)
;; There might be an error if the monitor is not supported.
;; Give the filter a chance to read the output.
(while (tramp-accept-process-output p 0))
......@@ -5957,5 +5958,7 @@ function cell is returned to be applied on a buffer."
;; * Implement detaching/re-attaching remote sessions. By this, a
;; session could be reused after a connection loss. Use dtach, or
;; screen, or tmux, or mosh.
;;
;; * Implement `:stderr' of `make-process' as pipe process.
;;; tramp-sh.el ends here
......@@ -9,6 +9,7 @@
;; Package: tramp
;; Version: 2.4.2-pre
;; Package-Requires: ((emacs "24.1"))
;; URL: https://savannah.gnu.org/projects/tramp
;; This file is part of GNU Emacs.
......@@ -3854,6 +3855,12 @@ of."
(concat (file-remote-p default-directory)
(process-get proc 'watch-name))))))
(defun tramp-file-notify-process-sentinel (proc event)
"Call `file-notify-rm-watch'."
(unless (process-live-p proc)
(tramp-message proc 5 "Sentinel called: `%S' `%s'" proc event)
(file-notify-rm-watch proc)))
;;; Functions for establishing connection:
;; The following functions are actions to be taken when seeing certain
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment