thread_sleep: ignore signal interruption

This commit is contained in:
def 2019-03-24 23:14:37 +01:00
parent 958778b441
commit ea6b741eb8

View file

@ -758,7 +758,8 @@ void thread_sleep(int microseconds)
{
#if defined(CONF_FAMILY_UNIX)
int result = usleep(microseconds);
if(result == -1)
/* ignore signal interruption */
if(result == -1 && errno != EINTR)
dbg_msg("thread", "sleep failed: %d", errno);
#elif defined(CONF_FAMILY_WINDOWS)
Sleep(microseconds/1000);