projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
850c5cf
)
tdb2: restore file filling code.
author
Rusty Russell
<rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:19 +0000
(23:19 +1030)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:19 +0000
(23:19 +1030)
This snuck in
fe55330a
which added the stats attribute. Without it,
TDB works but is vulnerable to segmenation faults or write errors when
disk is exhausted.
ccan/tdb2/io.c
patch
|
blob
|
history
diff --git
a/ccan/tdb2/io.c
b/ccan/tdb2/io.c
index dffd088510c186377d433b292b63f7fca7e117d8..f326d98ba6d03e4c49e37409ae61280ae8a894bb 100644
(file)
--- a/
ccan/tdb2/io.c
+++ b/
ccan/tdb2/io.c
@@
-404,7
+404,7
@@
static int tdb_expand_file(struct tdb_context *tdb, tdb_len_t addition)
file isn't sparse, which would be very bad if we ran out of
disk. This must be done with write, not via mmap */
memset(buf, 0x43, sizeof(buf));
- if (
0 ||
fill(tdb, buf, sizeof(buf), tdb->map_size, addition) == -1)
+ if (fill(tdb, buf, sizeof(buf), tdb->map_size, addition) == -1)
return -1;
tdb->map_size += addition;
tdb_mmap(tdb);