]> git.proxmox.com Git - proxmox-backup.git/commit
tools/systemd/time: let libc normalize time for us
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 4 Sep 2020 12:33:25 +0000 (14:33 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 4 Sep 2020 13:26:40 +0000 (15:26 +0200)
commitc931c87173186b6126033d8b84bbd5d1eb73a6c1
treec9ec5b91d76a870dacd218ff3ad5b5c99dc5939b
parent28a0a9343c7f06d5237d89ab9c4ecc274c32d5f1
tools/systemd/time: let libc normalize time for us

mktime/gmtime can normalize time and even can handle special timezone
cases like the fact that the time 2:30 on specific day/timezone combos
do not exists

we have to convert the signature of all functions that use
normalize_time since mktime/gmtime can return an EOVERFLOW
but if this happens there is no way we can find a good time anyway

since normalize_time will always set wday according to the rest of the
time, remove set_wday

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/tools/systemd/time.rs
src/tools/systemd/tm_editor.rs