projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56320b5
)
Import 855391c1e37012b0d6c673a304bb8da8a1efcd72 from ctdb:
author
Rusty Russell
<rusty@rustcorp.com.au>
Tue, 2 Feb 2010 01:35:25 +0000
(12:05 +1030)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Tue, 2 Feb 2010 01:35:25 +0000
(12:05 +1030)
tdb: always set tdb->tracefd to -1 to be safe on goto fail
metze
(cherry picked from samba commit
85449b7bcc4bd7948bea38b5514a02357950a002
)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
ccan/tdb/open.c
patch
|
blob
|
history
diff --git
a/ccan/tdb/open.c
b/ccan/tdb/open.c
index 50f60816b77f5dd9ec986e527b812a8c6d116d47..77c6936fc2f5bac28b6c421f3d61f730cba71129 100644
(file)
--- a/
ccan/tdb/open.c
+++ b/
ccan/tdb/open.c
@@
-164,6
+164,9
@@
struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
tdb_io_init(tdb);
tdb->fd = -1;
+#ifdef TDB_TRACE
+ tdb->tracefd = -1;
+#endif
tdb->name = NULL;
tdb->map_ptr = NULL;
tdb->flags = tdb_flags;
@@
-208,10
+211,6
@@
struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: tdb_new_database failed!"));
goto fail;
}
-#ifdef TDB_TRACE
- /* All tracing will fail. That's ok. */
- tdb->tracefd = -1;
-#endif
goto internal;
}