when signal arrives, select() in fgSleepForEvents() returns
an error which is always printed out using fgWarning().
be wiser to print nothing when errno == EINTR to avoid
when doing glutPostRedisplay() or setting idlecallback
or whatever in the signal handler, a race condition exists
in fgSleepForEvents() between the if and the actual select
call. pselect() and sigprocmask() can be used to avoid
the problem (if the operating system has pselect. in linux
pselect is implemented using sigprocmask & select,
but at least using it makes the problem less likely).
a patch is attached.
Log in to post a comment.