Alexandre Julliard wrote:
... and it's better to risk an fd leak than to risk invalidating the cached value in case someone closes the fd when they shouldn't.
I'm not sure I agree. When someone closes a fd they shouldn't, that would lead to program crashing, and attention being brought to the problem. When someone leaks a fd, noone will notice.
Shachar