mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 23:42:32 +00:00
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:
parent
bb6eb0f6ea
commit
068324536c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user