libc: eliminate atexit handler for 'Rtc'

We never want to destruct the 'Rtc' because other atexit handlers may
depend on it (e.g., for updating modification times when closing files).
This commit is contained in:
Norman Feske 2019-10-30 23:04:34 +01:00 committed by Christian Helmuth
parent bb6eb0f6ea
commit 068324536c

View File

@ -16,6 +16,9 @@
#include <base/log.h>
#include <vfs/vfs_handle.h>
/* Genode-internal includes */
#include <base/internal/unmanaged_singleton.h>
/* libc includes */
#include <sys/time.h>
#include <sys/types.h>
@ -168,7 +171,7 @@ int clock_gettime(clockid_t clk_id, struct timespec *ts)
/*
* XXX move instance to Libc::Kernel
*/
static Rtc rtc(_rtc_path, *_watch_ptr);
Rtc &rtc = *unmanaged_singleton<Rtc>(_rtc_path, *_watch_ptr);
time_t const rtc_value = rtc.read();
if (!rtc_value) return Errno(EINVAL);