Patch from Fillod Stephane:
* The "rdate.patch" file makes rdate to NOT settimeofday if the date to be set equals current date. This prevents the system from experiencing nasty time discontinuities caused by sub-second changes, with a protocol that has only over second resolution. Depending on your taste, the "fprintf(stderr..." may be removed.
This commit is contained in:
parent
769a3ef08d
commit
89f10bcf37
@ -103,8 +103,14 @@ int rdate_main(int argc, char **argv)
|
|||||||
remote_time = askremotedate(argv[optind]);
|
remote_time = askremotedate(argv[optind]);
|
||||||
|
|
||||||
if (setdate) {
|
if (setdate) {
|
||||||
if (stime(&remote_time) < 0)
|
time_t current_time;
|
||||||
bb_perror_msg_and_die("Could not set time of day");
|
|
||||||
|
time(¤t_time);
|
||||||
|
if (current_time == remote_time)
|
||||||
|
bb_error_msg("Current time matches remote time.");
|
||||||
|
else
|
||||||
|
if (stime(&remote_time) < 0)
|
||||||
|
bb_perror_msg_and_die("Could not set time of day");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printdate)
|
if (printdate)
|
||||||
|
Loading…
Reference in New Issue
Block a user