about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gn/db/mysql.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/gn/db/mysql.scm b/gn/db/mysql.scm
index 623a726..8da7b60 100644
--- a/gn/db/mysql.scm
+++ b/gn/db/mysql.scm
@@ -37,9 +37,10 @@
     )))
 
 (define (call-with-db thunk)
-  (let [(db (db-open))]
-    (thunk db)
-    (dbi-close db)))
+  (let* [(db (db-open))
+         (result (thunk db))]
+    (dbi-close db)
+    result))
 
 (define (ensure db msg1)
   "Use DBI-style handle to report an error. On error the program will stop."