> 
> What is the reason for this patch?
> 
This change is something I would like to have a second opinion. So, thanks for 
the question.

Originally at the end of sys_ntp_adjtime(), if the function copyout() doesn't 
return an error, the value returned by ntp_is_time_error(), which variable name 
is retval, is saved in td->td_retval[0]. Chris modified this, being retval 
saved in the variable error, which is the one returned by sys_ntp_adjtime().

Under some situations, ntp_adjtime() is called with modes = 0 just for 
retrieving some values (for example here 
https://github.com/ptpd/ptpd/blob/master/src/dep/sys.c#L2036, please notice 
that here adjtimex() is ntp_adjtime()). In those cases, returning retval may 
not be meaningful. Other similar situation happens when mode is MOD_TAI 
(https://github.com/ptpd/ptpd/blob/master/src/dep/sys.c#L2070). 

This is more or less the reason. If there is better way to solve this, is 
welcome.
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to