Still, it's a little weird that it only prints to file descriptor 2 (hard-wired), if STDERR is closed.Uhm, the kernel itself doesn't know anything about stderr. It's a convention used by utilities. And the convention is, "file descriptor 2 is stderr". (Just as file descriptor 1 is stdout, and file descriptor 0 is stdin).
Making the file descriptor variable would break many things, not in the least the expectation of users.
In reply to Re^3: Using warn() when STDERR is closed
by JavaFan
in thread Using warn() when STDERR is closed
by akeyes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |