aboutsummaryrefslogtreecommitdiff
path: root/src/connection.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-06 13:54:20 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-06 13:54:20 -0700
commit229bd52e31f6cb5b195f5615b8a585a7583b3ce6 (patch)
treefd6fee9ecad9080c43d901ce91a9dba3fc9717c3 /src/connection.lisp
parent6e15e8f3d71236461477175221d5f8e05a1d0ced (diff)
downloadconsfigurator-229bd52e31f6cb5b195f5615b8a585a7583b3ce6.tar.gz
MKTEMP needs to check for presence of output, not just zero exit
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection.lisp')
-rw-r--r--src/connection.lisp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/connection.lisp b/src/connection.lisp
index eeda6e3..fb873a7 100644
--- a/src/connection.lisp
+++ b/src/connection.lisp
@@ -178,12 +178,14 @@ the root Lisp's machine. For example, using rsync(1) over SSH."))
connection
"echo 'mkstemp('${TMPDIR:-/tmp}'/tmp.XXXXXX)' | m4 2>/dev/null || mktemp"
nil)
- (if (= exit 0)
- (car (lines out))
- (error 'run-failed :cmd "(attempt to make a temporary file on remote)"
- :stdout out
- :stderr "(merged with stdout)"
- :exit-code exit))))
+ (let ((lines (lines out)))
+ (if (and (zerop exit) lines)
+ (car lines)
+ (error 'run-failed
+ :cmd "(attempt to make a temporary file on remote)"
+ :stdout out
+ :stderr "(merged with stdout)"
+ :exit-code exit)))))
(defmacro %process-run-args (&body forms)
`(let (cmd input may-fail for-exit env princ)