mirror of git://git.musl-libc.org/musl
fix fclose return status logic, again
the previous fix was incorrect, as it would prevent f->close(f) from being called if fflush(f) failed. i believe this was the original motivation for using | rather than ||. so now let's just use a second statement to constrain the order of function calls, and to back to using |.
This commit is contained in:
parent
bd67467325
commit
78c808b126
|
@ -13,7 +13,8 @@ int fclose(FILE *f)
|
||||||
OFLUNLOCK();
|
OFLUNLOCK();
|
||||||
}
|
}
|
||||||
|
|
||||||
r = -(fflush(f) || f->close(f));
|
r = fflush(f);
|
||||||
|
r |= f->close(f);
|
||||||
|
|
||||||
if (!perm) free(f);
|
if (!perm) free(f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue