(EFF_STATIC): New.
(empfile): Use it. (ef_open): Oops on it (not implemented). (ef_close): Implement it (trivial).
This commit is contained in:
parent
62c80be94c
commit
babf467e15
3 changed files with 27 additions and 17 deletions
|
@ -94,6 +94,12 @@ ef_open(int type, int how)
|
|||
return 0;
|
||||
}
|
||||
ep->fids = fsiz / ep->size;
|
||||
|
||||
/* allocate cache */
|
||||
if (CANT_HAPPEN(ep->flags & EFF_STATIC)) {
|
||||
/* not implemented */
|
||||
ep->flags &= ~EFF_STATIC;
|
||||
}
|
||||
if (how & EFF_MEM)
|
||||
ep->csize = ep->fids;
|
||||
else
|
||||
|
@ -140,8 +146,10 @@ ef_close(int type)
|
|||
retval = ef_flush(type);
|
||||
ep = &empfile[type];
|
||||
ep->flags &= ~EFF_OPEN;
|
||||
free(ep->cache);
|
||||
ep->cache = NULL;
|
||||
if (!(ep->flags & EFF_STATIC)) {
|
||||
free(ep->cache);
|
||||
ep->cache = NULL;
|
||||
}
|
||||
if (close(ep->fd) < 0) {
|
||||
logerror("Error closing %s (%s)", ep->name, strerror(errno));
|
||||
retval = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue