* lisp/net/tramp-adb.el (tramp-adb-handle-process-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-process-file): Handle signals.
* test/lisp/net/tramp-tests.el (tramp-test28-process-file): Adapt test.
(kill-buffer (tramp-get-connection-buffer v))
(setq ret 1)))
+ ;; Handle signals.
+ (when (and (natnump ret) (> ret 128))
+ (setq ret (format "Signal %d" (- ret 128))))
+
;; Provide error file.
(when tmpstderr (rename-file tmpstderr (cadr destination) t))
(kill-buffer (tramp-get-connection-buffer v))
(setq ret 1)))
+ ;; Handle signals.
+ (when (and (natnump ret) (> ret 128))
+ (setq ret (format "Signal %d" (- ret 128))))
+
;; Provide error file.
(when tmpstderr (rename-file tmpstderr (cadr destination) t))
(should-not (zerop (process-file "false")))
(should-not (zerop (process-file "binary-does-not-exist")))
(should (= 42 (process-file "sh" nil nil nil "-c" "exit 42")))
+ ;; Return string in case the process is interrupted.
+ (should (stringp (process-file "sh" nil nil nil "-c" "kill -2 $$")))
(with-temp-buffer
(write-region "foo" nil tmp-name)
(should (file-exists-p tmp-name))