Account for FirstRun.pm when counting fds to not close-on-exec
Fixes #111 (closed), it seems.
The fd we're trying to pass to dialog
is 5, but this code seemed to expect it would be 4 and sets $^F
so it wouldn't be closed-on-exec. But now, fd 4 is FirstRun.pm
so fd 5 has already been closed by the time dialog
gets it.
I'll be the first to admit this is a really fragile hack. Seems like we'd need to either tell IO::Pipe
to open its fds without close-on-exec, or use Fcntl
to clear the flag explicitly after the fds are opened. But I don't really know any Perl, and am actively trying to avoid having to start learning.