blob: 2926f7c7a2bcfe4cd0fc254f53160741ea94bbbe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
--- a/getdate.c
+++ b/getdate.c
@@ -214,7 +214,9 @@
/* Dangerous! Could upset cron and other
* timer related events.
*/
- stime(&new_time);
+ struct timespec s = {0};
+ s.tv_sec = new_time;
+ clock_settime(CLOCK_REALTIME, &s);
print_samples(host, first_sample, second_sample);
printf("getdate: set time to %s to match host %s\n",
time_to_str(new_time),
|