Commit 898a9c33 authored by Ondrej Holy's avatar Ondrej Holy

gunixmounts: Prevent invalid time_read timestamps

The `get_mounts_timestamp()` function uses `mount_poller_time` when
`proc_mounts_watch_source` is set, but the `mount_poller_time` is not
initialized in the same time as `proc_mounts_watch_source`. This may
cause that zero, or some outdated value is returned. Let's initialize
`mount_poller_time` to prevent invalid values to be returned.
parent 972b9776
......@@ -1890,6 +1890,7 @@ mount_monitor_start (void)
G_LOCK (proc_mounts_source);
proc_mounts_watch_source = g_io_create_watch (proc_mounts_channel, G_IO_ERR);
mount_poller_time = (guint64) g_get_monotonic_time ();
g_source_set_callback (proc_mounts_watch_source,
(GSourceFunc) proc_mounts_changed,
NULL, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment