From b567999fece4bf0a798c0eb5cac6e9b3dffcf81d Mon Sep 17 00:00:00 2001 From: sunghan Date: Thu, 8 Jun 2017 13:49:06 +0900 Subject: [PATCH] modify argument name of gettimeofday In POSIX, tv and tz are used. --- os/include/sys/time.h | 2 +- os/kernel/clock/clock_gettimeofday.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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; -- 2.7.4