aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2012-12-05 16:50:32 +0100
committerMichael Albinus2012-12-05 16:50:32 +0100
commit82176fcdeb6ec2fb09224087ff852ebc16d3cfb5 (patch)
treed64aa5e3b2413d676d84971856fa03478b059718
parentd5f97f62956d942b1c92802e0a632abb471359b2 (diff)
downloademacs-82176fcdeb6ec2fb09224087ff852ebc16d3cfb5.tar.gz
emacs-82176fcdeb6ec2fb09224087ff852ebc16d3cfb5.zip
* tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Check error
code also on MS-Windows machines.
-rw-r--r--lisp/net/tramp-sh.el37
1 files changed, 17 insertions, 20 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 28a06b2a647..79a1d8aec7d 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2387,10 +2387,9 @@ The method used must be an out-of-band method."
2387 copy-args 2387 copy-args
2388 (list 2388 (list
2389 (shell-quote-argument source) 2389 (shell-quote-argument source)
2390 (shell-quote-argument target)) 2390 (shell-quote-argument target)
2391 (unless (memq system-type '(windows-nt)) 2391 "&&" "echo" "tramp_exit_status" "0"
2392 '(";" "echo" 2392 "||" "echo" "tramp_exit_status" "1"))))))
2393 "tramp_exit_status" "$?")))))))
2394 (tramp-message 2393 (tramp-message
2395 orig-vec 6 "%s" 2394 orig-vec 6 "%s"
2396 (mapconcat 'identity (process-command p) " ")) 2395 (mapconcat 'identity (process-command p) " "))
@@ -2398,22 +2397,20 @@ The method used must be an out-of-band method."
2398 (tramp-process-actions 2397 (tramp-process-actions
2399 p v nil tramp-actions-copy-out-of-band) 2398 p v nil tramp-actions-copy-out-of-band)
2400 2399
2401 ;; Check the return code. This does not work under 2400 ;; Check the return code.
2402 ;; MS Windows. 2401 (goto-char (point-max))
2403 (unless (memq system-type '(windows-nt)) 2402 (unless
2404 (goto-char (point-max)) 2403 (re-search-backward "tramp_exit_status [0-9]+" nil t)
2405 (unless 2404 (tramp-error
2406 (re-search-backward "tramp_exit_status [0-9]+" nil t) 2405 orig-vec 'file-error
2407 (tramp-error 2406 "Couldn't find exit status of `%s'" (process-command p)))
2408 orig-vec 'file-error 2407 (skip-chars-forward "^ ")
2409 "Couldn't find exit status of `%s'" (process-command p))) 2408 (unless (zerop (read (current-buffer)))
2410 (skip-chars-forward "^ ") 2409 (forward-line -1)
2411 (unless (zerop (read (current-buffer))) 2410 (tramp-error
2412 (forward-line -1) 2411 orig-vec 'file-error
2413 (tramp-error 2412 "Error copying: `%s'"
2414 orig-vec 'file-error 2413 (buffer-substring (point-min) (point-at-eol))))))
2415 "Error copying: `%s'"
2416 (buffer-substring (point-min) (point-at-eol)))))))
2417 2414
2418 ;; Reset the transfer process properties. 2415 ;; Reset the transfer process properties.
2419 (tramp-message orig-vec 6 "\n%s" (buffer-string)) 2416 (tramp-message orig-vec 6 "\n%s" (buffer-string))