From 50a501dbe89ec8f9a76540015890dd361f1ec8a1 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 10 May 2006 19:24:40 +0000 Subject: Merge-in RTEMS port patch by Phil Torre , alpha release. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@433 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/os_time_unix.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'pjlib/src/pj/os_time_unix.c') diff --git a/pjlib/src/pj/os_time_unix.c b/pjlib/src/pj/os_time_unix.c index b5733b64..081d97c8 100644 --- a/pjlib/src/pj/os_time_unix.c +++ b/pjlib/src/pj/os_time_unix.c @@ -17,23 +17,30 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H!=0 # include #endif +#include + /////////////////////////////////////////////////////////////////////////////// PJ_DEF(pj_status_t) pj_gettimeofday(pj_time_val *p_tv) { - struct timeval tv; + struct timeval the_time; + int rc; PJ_CHECK_STACK(); - gettimeofday(&tv, NULL); - p_tv->sec = tv.tv_sec; - p_tv->msec = tv.tv_usec / 1000; + rc = gettimeofday(&the_time, NULL); + if (rc != 0) + return PJ_RETURN_OS_ERROR(pj_get_native_os_error()); + + p_tv->sec = the_time.tv_sec; + p_tv->msec = the_time.tv_usec / 1000; return PJ_SUCCESS; } -- cgit v1.2.3