Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -1944,20 +1944,29 @@ (null? toplevels)) #f #t))))) (define (db:get-status-from-final-status-file run-dir) - (let ((infile (conc run-dir "/.final-status"))) + (let* ((infile (conc run-dir "/.final-status")) + (found (file-exists? infile))) ;; first verify we are able to write the output file - (if (and (file-exists? infile) - (not (file-readable? infile))) - (begin - (debug:print 0 *default-log-port* "ERROR: cannot read " infile) - (debug:print 0 *default-log-port* "ERROR: run-dir is " run-dir) - #f) - (with-input-from-file infile read-lines)))) - + (cond + ((not found) #f) + ((and (file-exists? infile) + (not (file-readable? infile))) + (debug:print 0 *default-log-port* "ERROR: cannot read " infile) + (debug:print 0 *default-log-port* "ERROR: run-dir is " run-dir) + #f) + (else + (let ((res (condition-case + (with-input-from-file infile read-lines) + (exn (i/o file) #f)))) + (cond + ((equal? res "#!eof") #f) + ((eof-object? res) #f) + (else res))))))) + ;; select end_time-now from ;; (select testname,item_path,event_time+run_duration as ;; end_time,strftime('%s','now') as now from tests where state in ;; ('RUNNING','REMOTEHOSTSTART','LAUNCHED'));