summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Carrijo <fcarrijo@yahoo.com.br>2010-08-05 02:59:31 -0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-08-05 16:37:06 +0300
commit65cb8812c715079f1d92238d5283f309db60fc92 (patch)
tree18d8d5811e3b60ab9624a5b892144a8b474bf4ee
parent30c4c00fcb77170e7d9ad959c2b2c221ae11f330 (diff)
os: inputthread: select() cannot return 0 for a NULL timeout
Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
-rw-r--r--os/inputthread.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/os/inputthread.c b/os/inputthread.c
index 1a7967bd0..9d0397280 100644
--- a/os/inputthread.c
+++ b/os/inputthread.c
@@ -106,20 +106,17 @@ WaitForInput(void* argument)
i = Select(MaxInputDevices, &ReadyInputDevices, NULL, NULL, NULL);
DebugF("inputthread: WaitForInput() awakening from Select()\n");
- if (i <= 0) /* An error or timeout occurred */
+ if (i < 0) /* An error occurred */
{
- if (i < 0) /* This logic are stolen from WaitFor.c */
+ if (errno == EINVAL)
{
- if (errno == EINVAL)
- {
- FatalError("WaitForInput(): select: %s\n",
- strerror(errno));
- }
- else if (errno != EINTR && errno != EAGAIN)
- {
- ErrorF("WaitForInput(): select: %s\n",
- strerror(errno));
- }
+ FatalError("WaitForInput(): select: %s\n",
+ strerror(errno));
+ }
+ else if (errno != EINTR && errno != EAGAIN)
+ {
+ ErrorF("WaitForInput(): select: %s\n",
+ strerror(errno));
}
}