mirror of
https://github.com/flatpak/flatpak.git
synced 2026-06-26 17:26:50 -04:00
We can't easily assert this without triggering warnings from tools like valgrind by doing an invalid operation on a closed fd, so we only check this when under `-m undefined`. Originally contributed to GLib 2.76 in GNOME/glib@b3934133 "gstdio: Add g_clear_fd() and g_autofd". The implementation in GLib used g_fsync() as a portable thing that we can do with a fd, but that function is newer than our minimum GLib version, and libglnx isn't portable to non-Unix anyway, so use fnctl() instead. Signed-off-by: Simon McVittie <smcv@collabora.com>