On Tue, 14 Jul 2026 19:29:21 +1000
David Gibson
Most functions in util.c are, well, utilities, that are useful in a bunch of places. close_open_files(), however, is very specific, it's only called from isolate_initial(), and really only can be called from there - it's
Nit: its
logic encodes a very specific action we want to take at that point.
So, remove it from util.c and fold into isolate_initial().
To me this doesn't actually look like an improvement (well, of course, otherwise I would have structured commit 09603cab28f9 ("passt, util: Close any open file that the parent might have leaked") differently) exactly because close_open_files() is very specific and does exactly that one thing, contributing to a shorter version of isolate_initial(). Now, I realise that we're pretty far from "fixing" https://bugs.passt.top/show_bug.cgi?id=31, but still, isolate_initial() in its current form looks much more digestible than a version with thirty-three lines added on top. It currently has a specific role and that's conceptually a separated operation, regardless of the fact it has a single caller. On top of that, the function comment to close_open_files() disappears this way, because it has no natural place anymore. But I think that was rather useful.
Signed-off-by: David Gibson
By the way, should you respin, you could probably Cc: Ammar as he volunteered to review this kind of series. I would also suggest Cc'ing reporters (and marking them as such when doable). -- Stefano