export: Fix incorrect usage of GFileInfo attributes
Check if a GFileInfo
attribute exists before reading it. It's an error to read a GFileInfo
attribute when it doesn't exist. So, this fixes the following GLib criticals messages, which are emitted for each file processed by osinfo-db-export
.
(osinfo-db-export:136620): GLib-GIO-CRITICAL **: 07:49:13.446: file ../../../gio/gfileinfo.c: line 1633 (g_file_info_get_is_hidden): should not be reached
(osinfo-db-export:136620): GLib-GIO-CRITICAL **: 07:49:13.446: GFileInfo created without standard::is-backup
(osinfo-db-export:136620): GLib-GIO-CRITICAL **: 07:49:13.446: file ../../../gio/gfileinfo.c: line 1655 (g_file_info_get_is_backup): should not be reached
(osinfo-db-export:136620): GLib-GIO-CRITICAL **: 07:49:13.447: GFileInfo created without standard::is-hidden
This change was introduced in GLib 2.78 to enforce proper usage of GFileInfo
attributes
Refer: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3338
Signed-off-by: sid sidtosh4@gmail.com