git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cfed5f9
)
tdb: reset tdb->fd to -1 in tdb_close()
author
Kirill Smelkov
<kirr@mns.spb.ru>
Wed, 21 Oct 2009 17:18:56 +0000
(21:18 +0400)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Wed, 28 Oct 2009 23:44:33 +0000
(10:14 +1030)
So that erroneous double tdb_close() calls do not try to close() same
fd again. This is like SAFE_FREE() but for fd.
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/tdb/common/open.c
patch
|
blob
|
history
diff --git
a/lib/tdb/common/open.c
b/lib/tdb/common/open.c
index 1ba2e7bd11afe43cce4230aea4cc58d1e668f4e0..64efafeb22647c0e273d7f7621af420e6427af68 100644
(file)
--- a/
lib/tdb/common/open.c
+++ b/
lib/tdb/common/open.c
@@
-403,8
+403,10
@@
int tdb_close(struct tdb_context *tdb)
tdb_munmap(tdb);
}
SAFE_FREE(tdb->name);
- if (tdb->fd != -1)
+ if (tdb->fd != -1)
{
ret = close(tdb->fd);
+ tdb->fd = -1;
+ }
SAFE_FREE(tdb->lockrecs);
/* Remove from contexts list */