| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* add command line option --delay <seconds>
* read RTC type from /sys/class/rtc/rtc<N>/name
* default to 0.5 (500ms) for rtc_cmos or when RTC type is impossible
determine; otherwise delay is 0.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Undocumented at this time, because it is a skeleton
implementation. More debugging points are to be added after
refactoring is complete, or ad hoc in the mean time.
When fully implemented, enough time may have passed that the
deprecated --debug could be used to replace --ul-debug.
[kzak@redhat.com: - use __UL_INIT_DEBUG_FROM_STRING() to initialize the mask
- add hwclock_init_debug()]
Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Warn on --debug; do not fallthrough because
the message is lost in the verbose output.
Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
| |
Use plain int instead of type defining it to a boolean, and use numbers to
signify true or false as we do everywhere else in this source tree. And in
hwclock-cmos.c file booleans weren't even needed, to the related code is
removed.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
| |
The select() synchronization branch only returns success or
fail. There is no reason for the busywait branch to do more.
If synchronization fails for any reason then it must exit,
otherwise all drift correction operation will be invalid.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Custom errno messages are unnecessary and problematic for translators.
hwclock --directisa
hwclock: iopl() port access failed: Operation not permitted
hwclock: root privileges may be required
The custom errno message is misleading. We do not know what
the system permissions are set to. The default errno string is
correct, and enough.
Patched:
hwclock --directisa
hwclock: iopl() port access failed: Operation not permitted
root@:~# hwclock --directisa -D
Using direct ISA access to the clock
2017-07-24 14:49:17.782716-0400
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
| |
Also one whitespace fix.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hwclock --setepoch --epoch 0
Will warn that the epoch option is required.
The --epoch presence test is made on its argument after it is
converted to an integer. This means any value it can be tested
for, can also be given as an input.
So make the conversion after the presence test, like the
--date option does.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang warned:
CC sys-utils/hwclock.o
../sys-utils/hwclock.c:1274:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
We have to move the noreturn attribute from the function definition
to the declaration.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sys-utils/prlimit.c: In function 'do_prlimit':
sys-utils/prlimit.c:367:16: warning: format '%ju' expects argument of type 'uintmax_t', but argument 2 has type 'rlim_t {aka long long unsigned int}' [-Wformat=]
printf("<%ju", new->rlim_cur);
lib/plymouth-ctrl.c: In function 'open_un_socket_and_connect':
lib/plymouth-ctrl.c:88:20: warning: passing argument 2 of 'connect' from incompatible pointer type [-Wincompatible-pointer-types]
ret = connect(fd, &su, offsetof(struct sockaddr_un, sun_path) + 1 + strlen(su.sun_path+1));
^
In file included from lib/plymouth-ctrl.c:35:0:
/usr/include/sys/socket.h:314:5: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_un *'
int connect (int, const struct sockaddr *, socklen_t);
login-utils/last.c: In function 'list':
login-utils/last.c:506:54: warning: pointer targets in passing argument 4 of 'dns_lookup' differ in signedness [-Wpointer-sign]
r = dns_lookup(domain, sizeof(domain), ctl->useip, p->ut_addr_v6);
^
login-utils/last.c:291:12: note: expected 'int32_t * {aka int *}' but argument is of type 'unsigned int *'
static int dns_lookup(char *result, int size, int useip, int32_t *a)
^~~~~~~~~~
In file included from sys-utils/hwclock-cmos.c:92:0:
sys-utils/hwclock.h:67:32: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
extern double time_diff(struct timeval subtrahend, struct timeval subtractor);
misc-utils/test_uuidd.c: In function 'create_nthreads':
misc-utils/test_uuidd.c:187:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
proc->pid, (int) th->tid, th->index));
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
|
|
|
|
|
|
|
|
|
| |
Move audit control to option parsing. This fixes non-alpha build
error and cleans up an unruly 'if' statement.
Having audit control in option parsing may also draw awareness to
the audit system when adding new functions, which could easily be
overlooked otherwise.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's been 19.1315 years since the comment below was written and the kernel
has actually gone further away from allowing an RTC epoch on ISA machines.
/*
* Maintenance note: This should work on non-Alpha machines, but the
* evidence today (98.03.04) indicates that the kernel only keeps the epoch
* value on Alphas. If that is ever fixed, this function should be changed.
*/
The current behavior is to accept the epoch options on ISA machines
only to print a lengthy message explaining that you cannot use them.
This patch removes that behavior, making the epoch functions truly Alpha
only, as the man-page states that they are.
* sys-utils/hwclock.c: make epoch function alpha only.
* sys-utils/hwclock.h: same.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 'silent' argument for get_epoch_rtc() was used
to silence error messages when querying the rtc
driver for an alpha epoch while using cmos direct
access. Alpha cmos has since been removed so
'silent' is no longer used.
* sys-utils/hwclock.h: remove 'silent' argument
* sys-utils/hwclock.c: same
* sys-utils/hwclock-rtc.c: same
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove alpha direct I/O access, use RTC instead:
http://marc.info/?l=util-linux-ng&m=141682406902804
Resolves the alpha 2020 issue for util-linux:
http://marc.info/?l=util-linux-ng&m=148387021519787
Now it is only the kernel's RTC problem.
* sys-utils/hwclock.c: remove alpha cmos
* sys-utils/hwclock-cmos.c: same
* sys-utils/hwclock.h: same
* sys-utils/hwclock.8.in: same
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the 1994 Award BIOS bug workaround as
previously discussed more than two years ago:
http://marc.info/?l=util-linux-ng&m=141682406902804&w=2
* sys-utils/hwclock.c: remove badyear option
* sys-utils/hwclock.h: same
* sys-utils/hwclock.8.in: same
Signed-off-by: J William Piggott <elseifthen@gmx.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Compare functionality was printing nonsense values. There is no knowledge
of anyone using this broken functionality. Instead of deprecating the code
for months, and removing it after few release, it is removed immediately.
Needless to say this is unusual removal.
Reference: http://marc.info/?l=util-linux-ng&m=148396210506652&w=2
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
| |
The manipulate_clock() is seeing return value from
busywait_for_rtc_clock_tick().
And the get_permissions_cmos() can see i386_iopl() return value.
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The control structure is read-only everywhere else but in main(). Almost
all changes are about how variables are referred, with one exception. Calls
to read_adjtime() from manipulate_clock() and compare_clock() are moved to
main(). This way it is possible to keep variable that tells if hwclock is
using UTC-0 be part of control structure.
Changes within #ifdef __alpha__ segments were tested by flipping the
preprocessor directivive otherway around and getting good compilaton all the
way to the point where linking on none-alpha system failed.
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
| |
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
|
|
|
| |
The KDGHWCLK has been gone quite a while.
Reference: http://marc.info/?l=linux-kernel&m=104171103925897
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
|
| |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|