On Mon, Nov 22, 2021 at 02:07:09PM +0300, Dmitry Koval wrote:
> > It reads a little too much like pseudocode for my liking. Please
> > consider the attached version.
>
> This is a good comment, I like it.
/*
+ * Check if the fileno is a data stream. If so, unless it has been
+ * redirected to a file, getting information by handle will fail. Return
+ * the appropriate stat information instead.
+ */
I would perhaps add an extra note that we emulate the result in the
best way we can. Anyway, what you have here looks basically enough.
Another thing that has been itching me on this thread is that we have
not been able to detect this problem even if we have tests in
copyselect.sql that cover those paths. Is that because running
vcregress.pl implies a redirection of stdout so we would never see,
except from a terminal?
--
Michael