Deleted Added
full compact
adjkerntz.c (114589) adjkerntz.c (128683)
1/*
2 * Copyright (C) 1993-1998 by Andrey A. Chernov, Moscow, Russia.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27#if 0
28#ifndef lint
29static const char copyright[] =
30"@(#)Copyright (C) 1993-1996 by Andrey A. Chernov, Moscow, Russia.\n\
31 All rights reserved.\n";
32#endif /* not lint */
33#endif
34#include <sys/cdefs.h>
1/*
2 * Copyright (C) 1993-1998 by Andrey A. Chernov, Moscow, Russia.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27#if 0
28#ifndef lint
29static const char copyright[] =
30"@(#)Copyright (C) 1993-1996 by Andrey A. Chernov, Moscow, Russia.\n\
31 All rights reserved.\n";
32#endif /* not lint */
33#endif
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sbin/adjkerntz/adjkerntz.c 114589 2003-05-03 18:41:59Z obrien $");
35__FBSDID("$FreeBSD: head/sbin/adjkerntz/adjkerntz.c 128683 2004-04-27 14:43:03Z ghelmer $");
36
37/*
38 * Andrey A. Chernov <ache@astral.msk.su> Dec 20 1993
39 *
40 * Fix kernel time value if machine run wall CMOS clock
41 * (and /etc/wall_cmos_clock file present)
42 * using zoneinfo rules or direct TZ environment variable set.
43 * Use Joerg Wunsch idea for seconds accurate offset calculation

--- 99 unchanged lines hidden (view full) ---

143
144 wall_clock = (access(_PATH_CLOCK, F_OK) == 0);
145 if (init && !sleep_mode) {
146 init = False;
147 if (!wall_clock)
148 return 0;
149 }
150
36
37/*
38 * Andrey A. Chernov <ache@astral.msk.su> Dec 20 1993
39 *
40 * Fix kernel time value if machine run wall CMOS clock
41 * (and /etc/wall_cmos_clock file present)
42 * using zoneinfo rules or direct TZ environment variable set.
43 * Use Joerg Wunsch idea for seconds accurate offset calculation

--- 99 unchanged lines hidden (view full) ---

143
144 wall_clock = (access(_PATH_CLOCK, F_OK) == 0);
145 if (init && !sleep_mode) {
146 init = False;
147 if (!wall_clock)
148 return 0;
149 }
150
151 tzset();
152
151 mib[0] = CTL_MACHDEP;
152 mib[1] = CPU_ADJKERNTZ;
153 len = sizeof(kern_offset);
154 if (sysctl(mib, 2, &kern_offset, &len, NULL, 0) == -1) {
155 syslog(LOG_ERR, "sysctl(get_offset): %m");
156 return 1;
157 }
158

--- 226 unchanged lines hidden ---
153 mib[0] = CTL_MACHDEP;
154 mib[1] = CPU_ADJKERNTZ;
155 len = sizeof(kern_offset);
156 if (sysctl(mib, 2, &kern_offset, &len, NULL, 0) == -1) {
157 syslog(LOG_ERR, "sysctl(get_offset): %m");
158 return 1;
159 }
160

--- 226 unchanged lines hidden ---