forked from alex-eg/sex
leave none of an output a failure stopped writing
A failed -C -o left the file truncated, which make would take for done.
This commit is contained in:
8
sexc.scm
8
sexc.scm
@@ -164,8 +164,12 @@
|
||||
(define (write-to-file-or-stdout output what)
|
||||
(if (stdout-output? output)
|
||||
(what)
|
||||
(with-output-to-file output
|
||||
(fn (what)))))
|
||||
;; a failure part way through leaves none of the file, which make
|
||||
;; would take for done
|
||||
(handle-exceptions exn
|
||||
(begin (delete-file* output) (abort exn))
|
||||
(with-output-to-file output
|
||||
(fn (what))))))
|
||||
|
||||
(define (emit-c-or-sex sex-forms output args)
|
||||
(write-to-file-or-stdout output
|
||||
|
||||
Reference in New Issue
Block a user