From ad67d4e83389611a2b5f658feda6e0a74b38fac0 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 22 Oct 2024 13:37:55 +0100 Subject: [PATCH] glocalfile: Disable faccessat()-based query_exists on FreeBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It appears not to work, and nobody interested in FreeBSD has picked it up to investigate yet. Rather than have a completely broken implementation of `g_file_query_exists()` on FreeBSD, let’s settle for using the old one. It’s slightly slower than the new one, but has worked fine for people for years. This essentially reverts commit 65ad41d8a473b4d47f1e470013caff93d50791d8 on FreeBSD. This commit can be reverted when a FreeBSD person investigates what’s going wrong with the `faccessat()`-based implementation. Signed-off-by: Philip Withnall Helps: #3495 --- gio/glocalfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 7c02cc36e..f0932f810 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -1259,7 +1259,9 @@ g_local_file_query_info (GFile *file, return info; } -#ifdef HAVE_FACCESSAT +/* FIXME: faccessat() is available on FreeBSD but appears to not work correctly + * here. This needs diagnosing; https://gitlab.gnome.org/GNOME/glib/-/issues/3495 */ +#if defined(HAVE_FACCESSAT) && !defined(__FreeBSD__) static gboolean g_local_file_query_exists (GFile *file, GCancellable *cancellable) @@ -3153,7 +3155,7 @@ g_local_file_file_iface_init (GFileIface *iface) iface->monitor_dir = g_local_file_monitor_dir; iface->monitor_file = g_local_file_monitor_file; iface->measure_disk_usage = g_local_file_measure_disk_usage; -#ifdef HAVE_FACCESSAT +#if defined(HAVE_FACCESSAT) && !defined(__FreeBSD__) iface->query_exists = g_local_file_query_exists; #endif