|
|
|
|
|
by asveikau
4431 days ago
|
|
Assuming all I/O failures are EINTR is really, really odd, as if to say disks never fill up or fail and sockets never disconnect. He does say: > in a real program you’d have to do real error handling instead of assertions, of course But somebody somewhere is reading this and thinking this is a "semantically correct pattern" (as it is introduced) and may just copy-paste it into their program. Especially when contrasting it with a "wrong way" I think it wouldn't hurt to include real error handling. And that means something that doesn't fall into an infinite loop when the disk fills up. |
|
The point is to retry on EINTR and to abort completely in case of other IO failures.
is equivalent to > But somebody somewhere is reading this and thinking this is a "semantically correct pattern" (as it is introduced) and may just copy-paste it into their program.Even if they do, it likely will not actually do any harm, it'll just kill the program instead of gracefully handle error.