diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2010-12-27 20:04:29 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2010-12-27 20:04:29 +0100 |
commit | c5c4dcc9cd471aa060be568491141703b96ae0f8 (patch) | |
tree | 5751d60aa16647d65671004bd16cc5f582ea96dd /src | |
parent | 9c1066ba50b82ab93079f668c78050a2fd646cf6 (diff) | |
download | pianobar-windows-c5c4dcc9cd471aa060be568491141703b96ae0f8.tar.gz pianobar-windows-c5c4dcc9cd471aa060be568491141703b96ae0f8.tar.bz2 pianobar-windows-c5c4dcc9cd471aa060be568491141703b96ae0f8.zip |
Fix high cpu usage if stdin is /dev/null
See issue #71.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -167,6 +167,10 @@ static void BarMainHandleUserInput (BarApp_t *app) { curFd = app->ctlFd; } buf = fgetc (curFd); + if (buf == EOF) { + /* select() is going wild if fdset contains EOFed fd's */ + FD_CLR (fileno (curFd), &app->readSet); + } size_t i; for (i = 0; i < BAR_KS_COUNT; i++) { |