3 ms·
To be honest, your solution doesn't sound more maintainable, because now I have to write a complicated longjmp handler and have global state variables that inte
by zaarn 6y ago
To be honest, your solution doesn't sound more maintainable, because now I have to write a complicated longjmp handler and have global state variables that interact with all my read calls.
That only maybe works if you write most of the application code yourself but it would be unrealistic in larger projects that have to do more than read from stdin and pop out data on the other end.
SIGPIPE should not exist, no matter what hacky ways you found to abuse it for your advantage in some edge cases.