Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339 was reviewed by Joel Sherrill
-- Joel Sherrill started a new discussion on cpukit/rtems/src/clockgettod.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_118499 > + time_of_day->hour = current_time_tm->tm_hour; > + time_of_day->minute = current_time_tm->tm_min; > time_of_day->second = time_of_day->minute % RTEMS_SECS_PER_MINUTE; If this line is still in the code, they should be deleted. You filled in second sabove. -- Joel Sherrill started a new discussion on cpukit/rtems/src/clockgettod.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_118500 > - } > + struct tm buf; > + time_t current_time = time(NULL); Do not fetch the current time again. You fetched it with _TOD_Get_timeval(). Use the tv_sec field with gmtime_r() and the tv_usec field of that for the ticks math. This lets you have only call to fetch the current time. -- Joel Sherrill started a new discussion on cpukit/rtems/src/clockgettod.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_118501 > + time_t current_time = time(NULL); > + struct tm *current_time_tm; > + current_time_tm = gmtime_r( ¤t_time, &buf ); Use now.tv_sec as I suggested above. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list bugs@rtems.org http://lists.rtems.org/mailman/listinfo/bugs