2 ms·
The "best" is way overengineered. I doubt this error-handling will even work. If the program fails to print "hello world" using puts then it is very likely to f
by colinhowe 16y ago
The "best" is way overengineered. I doubt this error-handling will even work. If the program fails to print "hello world" using puts then it is very likely to fail on fprintf to stderr.
- boredzo 16y agoOnly if both stdout and stderr are unwritable. If stdout is unwritable but stderr is writable, then writing to stderr should work. If they're both not writable, or stderr is writable but writing fails anyway, there's nothing we can do about it anyway, but that does not make it any less proper to try.