[haiku-commits] Re: haiku: hrev52646 - src/system/kernel/fs

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 13 Dec 2018 11:12:31 +0100

Am 13/12/2018 um 02:04 schrieb waddlesplash:

   axeld's solution from 2015 worked in that it solved the panics and
   problems with leaking FDs ... but only if nobody actually tried to
   use the FDs again. As you can see in the diff of the previous commit,
   in allowing closed FDs (which have NULL "ops") to be returned by get_fd,
   all consumers of the get_fd API (so, pretty much most functions in
   vfs.cpp and fd.cpp) have to check *both* that (1) the fd is not NULL,
   and (2) the fd does not have O_DISCONNECT set.

I don't really remember why I did it that way.
Is there a benefit of being able to get_fd() a disconnected FD?

Anyway, nice catch!

Bye,
   Axel.

Other related posts: