From aa82fda048bf105293e2bb39afc6bf337bb433de Mon Sep 17 00:00:00 2001 From: fredrik Date: Mon, 29 May 2006 19:46:22 +0000 Subject: [PATCH] Pass along exit status. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@624 959494ce-11ee-0310-bf91-de5d638817bd --- lib/guile/autodl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/guile/autodl b/lib/guile/autodl index 281c236..c8ce115 100755 --- a/lib/guile/autodl +++ b/lib/guile/autodl @@ -380,7 +380,7 @@ ) (define (autodl-main args) - (let ((dc-server #f) (done #f) (retval 0)) + (let ((dc-server #f) (done #f) (retval 0) (filterexit "")) (let ((getopt (make-getopt (cdr args) "whs:S:e:p:t:a:I:")) (arg #f)) (do ((arg (getopt) (getopt))) ((not (and (pair? arg) (char? (car arg)))) (set! args arg)) (cond ((eq? (car arg) #\h) @@ -409,6 +409,10 @@ (let ((c (assoc 'info-file session))) (if c (set-cdr! c (cdr arg)) (set! session (cons (cons 'info-file (cdr arg)) session))))) + ((eq? (car arg) #\E) + (let ((c (assoc 'estat-file session))) + (if c (set-cdr! c (cdr arg)) + (set! session (cons (cons 'estat-file (cdr arg)) session))))) ((eq? (car arg) #\e) (set! session (cons (cons 'sexpr (dc-lexsexpr (cdr arg))) session))) ((eq? (car arg) #\w) @@ -500,6 +504,7 @@ (begin (logf (string-append "transfer " (number->string (car ires)) " done")) (set! trans (assq-remove! trans (car ires))) (set! done #t) + (set! filterexit (cadr tr)) (throw 'sig 0)) (begin (logf (string-append "transfer " (number->string (car ires)) " disappeared")) (set! trans (assq-remove! trans (car ires))))))))) @@ -558,6 +563,11 @@ ))) (lambda (key sig) (logf "forcing quit"))) + (if (assoc 'estat-file session) + (let ((op (open-output-file (cdr (assoc 'estat-file session))))) + (write filterexit op) + (newline op) + (close-port op))) (exit retval) ) ) -- 2.11.0