mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 07:26:15 +01:00
Merge branch 'wip/oholy/nfs-poll-monitor' into 'master'
glocalfilemonitor: Fallback to poll file monitor for NFS See merge request GNOME/glib!219
This commit is contained in:
commit
7427bb7184
@ -834,6 +834,7 @@ static void g_local_file_monitor_class_init (GLocalFileMonitorClass *class)
|
||||
|
||||
static GLocalFileMonitor *
|
||||
g_local_file_monitor_new (gboolean is_remote_fs,
|
||||
gboolean is_directory,
|
||||
GError **error)
|
||||
{
|
||||
GType type = G_TYPE_INVALID;
|
||||
@ -843,7 +844,8 @@ g_local_file_monitor_new (gboolean is_remote_fs,
|
||||
"GIO_USE_FILE_MONITOR",
|
||||
G_STRUCT_OFFSET (GLocalFileMonitorClass, is_supported));
|
||||
|
||||
if (type == G_TYPE_INVALID)
|
||||
/* Fallback rather to poll file monitor for remote files, see gfile.c. */
|
||||
if (type == G_TYPE_INVALID && (!is_remote_fs || is_directory))
|
||||
type = _g_io_module_get_default_type (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME,
|
||||
"GIO_USE_FILE_MONITOR",
|
||||
G_STRUCT_OFFSET (GLocalFileMonitorClass, is_supported));
|
||||
@ -869,7 +871,7 @@ g_local_file_monitor_new_for_path (const gchar *pathname,
|
||||
|
||||
is_remote_fs = g_local_file_is_remote (pathname);
|
||||
|
||||
monitor = g_local_file_monitor_new (is_remote_fs, error);
|
||||
monitor = g_local_file_monitor_new (is_remote_fs, is_directory, error);
|
||||
|
||||
if (monitor)
|
||||
g_local_file_monitor_start (monitor, pathname, is_directory, flags, g_main_context_get_thread_default ());
|
||||
@ -890,7 +892,7 @@ g_local_file_monitor_new_in_worker (const gchar *pathname,
|
||||
|
||||
is_remote_fs = g_local_file_is_remote (pathname);
|
||||
|
||||
monitor = g_local_file_monitor_new (is_remote_fs, error);
|
||||
monitor = g_local_file_monitor_new (is_remote_fs, is_directory, error);
|
||||
|
||||
if (monitor)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user