summaryrefslogtreecommitdiff
path: root/modules/ssh
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-12-06 12:26:30 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-12-06 12:26:30 +0300
commit3110e4eef6a691ae515a4be9a8c0707b55083560 (patch)
treea5e5f7bd2ee2f024273004cd658111a6f349b331 /modules/ssh
parentdoc/api-channels.texi: Fix a typo (diff)
downloadguile-ssh-3110e4eef6a691ae515a4be9a8c0707b55083560.tar.gz
node.scm (rexec): Use 'open-remote-input-pipe'
* modules/ssh/dist/node.scm (rexec): Use 'open-remote-input-pipe'; simplify the code.
Diffstat (limited to 'modules/ssh')
-rw-r--r--modules/ssh/dist/node.scm9
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/ssh/dist/node.scm b/modules/ssh/dist/node.scm
index 02b29d1..926afd4 100644
--- a/modules/ssh/dist/node.scm
+++ b/modules/ssh/dist/node.scm
@@ -137,13 +137,8 @@ automatically in case when it is not started yet."
(define (rexec node cmd)
"Execute a command CMD on the remote side. Return two values: the first
line returned by CMD and its exit code."
- (let* ((s (node-session node))
- (c (make-channel s)))
- (channel-open-session c)
- (channel-request-exec c cmd)
- (let ((line (read-line c))
- (rc (channel-get-exit-status c)))
- (values line rc))))
+ (let ((channel (open-remote-input-pipe (node-session node) cmd)))
+ (values (read-line channel) (channel-get-exit-status channel))))
(define (rrepl-skip-to-prompt repl-channel)
"Read from REPL-CHANNEL until REPL is observed. Throw 'node-error' on an