Dolda2000 GitWeb
/
statserve.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c0cebb1
)
Make sure database and environment are properly closed by statdbput.
author
Fredrik Tolf
<fredrik@seatribe.se>
Fri, 17 Jun 2011 10:11:55 +0000
(12:11 +0200)
committer
Fredrik Tolf
<fredrik@seatribe.se>
Fri, 17 Jun 2011 10:11:55 +0000
(12:11 +0200)
statdbput.c
patch
|
blob
|
blame
|
history
diff --git
a/statdbput.c
b/statdbput.c
index
569afe1
..
061d5ee
100644
(file)
--- a/
statdbput.c
+++ b/
statdbput.c
@@
-212,6
+212,8
@@
int main(int argc, char **argv)
while(1) {
if((ret = env->txn_begin(env, NULL, &txn, 0)) != 0) {
fprintf(stderr, "statdbput: could not begin transaction in %s: %s\n", dbpath, db_strerror(ret));
while(1) {
if((ret = env->txn_begin(env, NULL, &txn, 0)) != 0) {
fprintf(stderr, "statdbput: could not begin transaction in %s: %s\n", dbpath, db_strerror(ret));
+ db->close(db, 0);
+ env->close(env, 0);
return(1);
}
rv = 0;
return(1);
}
rv = 0;
@@
-255,8
+257,12
@@
int main(int argc, char **argv)
}
if((ret = txn->commit(txn, 0)) != 0) {
fprintf(stderr, "statdbput: could not commit transaction in %s: %s\n", dbpath, db_strerror(ret));
}
if((ret = txn->commit(txn, 0)) != 0) {
fprintf(stderr, "statdbput: could not commit transaction in %s: %s\n", dbpath, db_strerror(ret));
+ db->close(db, 0);
+ env->close(env, 0);
return(1);
}
return(1);
}
+ db->close(db, 0);
+ env->close(env, 0);
if(ul) {
for(i = 0; i < files.d; i++) {
if(verbose)
if(ul) {
for(i = 0; i < files.d; i++) {
if(verbose)