Clean up ef_close() to zap csize along with cache
This commit is contained in:
parent
a485084777
commit
5d54e424df
1 changed files with 4 additions and 2 deletions
|
@ -258,14 +258,16 @@ ef_close(int type)
|
||||||
return 0;
|
return 0;
|
||||||
ep = &empfile[type];
|
ep = &empfile[type];
|
||||||
|
|
||||||
if (EF_IS_VIEW(type))
|
if (EF_IS_VIEW(type)) {
|
||||||
ep->cache = NULL;
|
ep->cache = NULL;
|
||||||
else {
|
ep->csize = 0;
|
||||||
|
} else {
|
||||||
if (!ef_flush(type))
|
if (!ef_flush(type))
|
||||||
retval = 0;
|
retval = 0;
|
||||||
if (!(ep->flags & EFF_STATIC)) {
|
if (!(ep->flags & EFF_STATIC)) {
|
||||||
free(ep->cache);
|
free(ep->cache);
|
||||||
ep->cache = NULL;
|
ep->cache = NULL;
|
||||||
|
ep->csize = 0;
|
||||||
}
|
}
|
||||||
if (close(ep->fd) < 0) {
|
if (close(ep->fd) < 0) {
|
||||||
logerror("Error closing %s (%s)", ep->file, strerror(errno));
|
logerror("Error closing %s (%s)", ep->file, strerror(errno));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue