diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-05-10 19:24:40 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-05-10 19:24:40 +0000 |
commit | 50a501dbe89ec8f9a76540015890dd361f1ec8a1 (patch) | |
tree | a45dac4292320647ed297b35239fccf38eb5885b /pjlib/src/pj/os_time_unix.c | |
parent | 5f10c756ac9d5f48efe2adbcccf5d54634540d61 (diff) |
Merge-in RTEMS port patch by Phil Torre <ptorre@zetron.com>, alpha release.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@433 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/os_time_unix.c')
-rw-r--r-- | pjlib/src/pj/os_time_unix.c | 15 |
1 files changed, 11 insertions, 4 deletions
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 <pj/os.h> +#include <pj/errno.h> #include <pj/compat/time.h> #if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H!=0 # include <unistd.h> #endif +#include <errno.h> + /////////////////////////////////////////////////////////////////////////////// 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; } |