Fixed ticket #181: Failed compilation because usleep() does not return int on some *nix platforms (thanks Jukka-Pekka Kervinen)

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1068 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-03-15 20:07:13 +00:00
parent de47956784
commit 4a5af681b8
1 changed files with 6 additions and 3 deletions

View File

@ -594,10 +594,13 @@ PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec)
return PJ_RETURN_OS_ERROR(pj_get_native_os_error());
#else
PJ_CHECK_STACK();
if (usleep(msec * 1000) == 0)
return PJ_SUCCESS;
return PJ_RETURN_OS_ERROR(pj_get_native_os_error());
pj_set_os_error(0);
usleep(msec * 1000);
return pj_get_os_error();
;
#endif /* PJ_RTEMS */
}