From: Evan Anderson Date: Thu, 16 Mar 2023 02:33:21 +0000 (-0500) Subject: core: Ensure glib standard::size attribute is always set X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2~2^2~21^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=376c9d7effa01fa020711a3f12829fe9b18b8bca;p=ostree.git core: Ensure glib standard::size attribute is always set * A recent change in glib [1] requires that the appropriate attribute be available when calling getters. ostree core only sets this attribute on regular files, and frequently triggers the critical warning. Solve this by setting standard::size to zero for non-regular files. Fixes https://github.com/ostreedev/ostree/issues/2827 [1]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3261 --- diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index 56b381d9..0d1b0d5d 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -1739,6 +1739,8 @@ _ostree_stbuf_to_gfileinfo (const struct stat *stbuf) if (S_ISREG (mode)) g_file_info_set_attribute_uint64 (ret, "standard::size", stbuf->st_size); + else + g_file_info_set_attribute_uint64 (ret, "standard::size", 0); return ret; }