Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: Fix potential crashes when writing to log fails with EAGAIN
The ioloop may nowadays call ioloop context switch callbacks. Since log writing can happen just about anywhere, the callbacks may be confused and cause crashes or other weird behavior. Even if the callbacks aren't called, all the extra code in ioloop can cause potential problems. Especially any error logging in it wouldn't work properly since it would just recurse back. So replace the ioloop code with just setting the log fd to be blocking until the write succeeds. This commit also removes comments about writes to a blocking terminal fd causing EAGAINs. This seems unlikely. Probably I was just somehow confused when originally seeing it and writing the code. If it actually does happen now, it's still not breaking anything, but it could get into a busy-loop of write()s constantly returning EAGAIN until they succeed.
- Loading branch information
1 parent
1998577
commit a6ab927
Showing
1 changed file
with
42 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters