Subject: Re: bug#21241: 25.0.50; gfilenotify doesn't indicate when limits are reached

From: Michael Albinus <[email-masked]>
Date: Fri, 21 Aug 2015 11:46:28 +0200

Tassilo Horn <[email-masked]> writes:

> So I've tried the following:
>
> diff --git a/src/gfilenotify.c b/src/gfilenotify.c
> index 08713a8..2ad2110 100644
> --- a/src/gfilenotify.c
> +++ b/src/gfilenotify.c
> @@ -172,8 +172,9 @@ will be reported only in case of the 'moved' event.  */)
>      gflags |= G_FILE_MONITOR_SEND_MOVED;
>  
>    /* Enable watch.  */
> -  monitor = g_file_monitor (gfile, gflags, NULL, NULL);
> -  if (! monitor)
> +  GError *err = NULL;
> +  monitor = g_file_monitor (gfile, gflags, NULL, &err);
> +  if (! monitor || err != NULL)
>      xsignal2 (Qfile_notify_error, build_string ("Cannot watch file"), file);
>  
>    Lisp_Object watch_descriptor = make_pointer_integer (monitor);

For the records, I've committed a modified version of this patch. It
returns the error message from g_file_monitor, if present.

Best regards, Michael.