Fix clearing mutable flags on ef_close()

Make ef_close() clear them always, even for views.  Harmless, as
ef_open_view() always sets the same flags.

Drop redundant assignment to ep->flags in ef_open().  ef_close()
clears mutable flags, no need to clear them some more right before
calling it.  Missed in commit 3eb3607f, v4.3.0.
This commit is contained in:
Markus Armbruster 2011-04-28 20:20:43 +02:00
parent 84cdd89060
commit 45c7337e70

View file

@ -145,7 +145,6 @@ ef_open(int type, int how, int nelt)
if ((how & EFF_MEM) && ep->fids) { if ((how & EFF_MEM) && ep->fids) {
if (fillcache(ep, 0) != ep->fids) { if (fillcache(ep, 0) != ep->fids) {
ep->cids = 0; /* prevent cache flush */ ep->cids = 0; /* prevent cache flush */
ep->flags &= EFF_IMMUTABLE; /* maintain invariant */
ef_close(type); ef_close(type);
return 0; return 0;
} }
@ -264,7 +263,6 @@ ef_close(int type)
else { else {
if (!ef_flush(type)) if (!ef_flush(type))
retval = 0; retval = 0;
ep->flags &= EFF_IMMUTABLE;
if (!(ep->flags & EFF_STATIC)) { if (!(ep->flags & EFF_STATIC)) {
free(ep->cache); free(ep->cache);
ep->cache = NULL; ep->cache = NULL;
@ -275,6 +273,7 @@ ef_close(int type)
} }
ep->fd = -1; ep->fd = -1;
} }
ep->flags &= EFF_IMMUTABLE;
ep->baseid = ep->cids = ep->fids = 0; ep->baseid = ep->cids = ep->fids = 0;
if (ep->onresize && ep->onresize(type) < 0) if (ep->onresize && ep->onresize(type) < 0)
retval = 0; retval = 0;