Fix up non-TDB_TRACE compile.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 29 Jul 2009 23:05:31 +0000 (08:35 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 29 Jul 2009 23:05:31 +0000 (08:35 +0930)
ccan/tdb/open.c

index d91f898bbd480c02780ccbf7523a1f5b6d722f48..0292920c11b4d565c1f4df9c1b7c032cea995d54 100644 (file)
@@ -349,8 +349,9 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
        if (!tdb)
                return NULL;
 
+#ifdef TDB_TRACE
        close(tdb->tracefd);
-       
+#endif
        if (tdb->map_ptr) {
                if (tdb->flags & TDB_INTERNAL)
                        SAFE_FREE(tdb->map_ptr);
@@ -410,7 +411,9 @@ int tdb_close(struct tdb_context *tdb)
                }
        }
 
+#ifdef TDB_TRACE
        close(tdb->tracefd);
+#endif
        memset(tdb, 0, sizeof(*tdb));
        SAFE_FREE(tdb);