gpgscm: Make it possible to set the logfile name.
authorJustus Winter <justus@g10code.com>
Thu, 11 May 2017 12:44:33 +0000 (14:44 +0200)
committerJustus Winter <justus@g10code.com>
Thu, 11 May 2017 15:41:01 +0000 (17:41 +0200)
* tests/gpgscm/tests.scm (test): Only set the default log filename
when it has not been set before.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/tests.scm

index e5ec5c7..490f95a 100644 (file)
        (current-environment))
 
       ;; The log is written here.
-      (define log-file-name "not set")
+      (define log-file-name #f)
 
       ;; Record time stamps.
       (define timestamp #f)
        (set! end-time (get-time)))
 
       (define (open-log-file)
-       (set! log-file-name (string-append (basename name) ".log"))
+       (unless log-file-name
+               (set! log-file-name (string-append (basename name) ".log")))
        (catch '() (unlink log-file-name))
        (open log-file-name (logior O_RDWR O_BINARY O_CREAT) #o600))