From: sunghan Date: Thu, 8 Jun 2017 04:49:06 +0000 (+0900) Subject: modify argument name of gettimeofday X-Git-Tag: 1.1_Public_Release~533^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b567999fece4bf0a798c0eb5cac6e9b3dffcf81d;p=rtos%2Ftinyara.git modify argument name of gettimeofday In POSIX, tv and tz are used. --- diff --git a/os/include/sys/time.h b/os/include/sys/time.h index 6bde1a4..99f5bfa 100644 --- a/os/include/sys/time.h +++ b/os/include/sys/time.h @@ -89,7 +89,7 @@ extern "C" { * @brief POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) * @since Tizen RT v1.0 */ -EXTERN int gettimeofday(struct timeval *tp, FAR struct timezone *tzp); +EXTERN int gettimeofday(struct timeval *tv, FAR struct timezone *tz); #undef EXTERN #if defined(__cplusplus) diff --git a/os/kernel/clock/clock_gettimeofday.c b/os/kernel/clock/clock_gettimeofday.c index cef1b4a..315f891 100644 --- a/os/kernel/clock/clock_gettimeofday.c +++ b/os/kernel/clock/clock_gettimeofday.c @@ -102,13 +102,13 @@ * ****************************************************************************/ -int gettimeofday(struct timeval *tp, FAR struct timezone *tzp) +int gettimeofday(struct timeval *tv, FAR struct timezone *tz) { struct timespec ts; int ret; #ifdef CONFIG_DEBUG - if (!tp) { + if (!tv) { set_errno(EINVAL); return ERROR; } @@ -120,8 +120,8 @@ int gettimeofday(struct timeval *tp, FAR struct timezone *tzp) if (ret == OK) { /* Convert the struct timespec to a struct timeval */ - tp->tv_sec = ts.tv_sec; - tp->tv_usec = ts.tv_nsec / NSEC_PER_USEC; + tv->tv_sec = ts.tv_sec; + tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC; } return ret;