mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gfileinfo: Zero GTimeVal when failing g_file_info_get_modification_time()
Before commited8e86a7d4
, this function would have silently returned a zero-valued `GTimeVal` if the correct attributes weren’t present. That partially regressed in commited8e86a7d4
, which made it return with a critical warning, but without zeroing the `GTimeVal`. The critical warning can be ignored by users (it doesn’t abort the process unless `G_DEBUG=fatal-criticals` is set), but the change in behaviour of zeroing the `GTimeVal` could cause bugs. See: #2907 Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
2029d7e900
commit
2953c08261
@ -1838,6 +1838,7 @@ g_file_info_get_modification_time (GFileInfo *info,
|
|||||||
if (G_UNLIKELY (value == NULL))
|
if (G_UNLIKELY (value == NULL))
|
||||||
{
|
{
|
||||||
g_critical ("GFileInfo created without " G_FILE_ATTRIBUTE_TIME_MODIFIED);
|
g_critical ("GFileInfo created without " G_FILE_ATTRIBUTE_TIME_MODIFIED);
|
||||||
|
result->tv_sec = result->tv_usec = 0;
|
||||||
g_return_if_reached ();
|
g_return_if_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user