diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gfilenotify.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gfilenotify.c b/src/gfilenotify.c index 5488fa38507..5c6ebe65d87 100644 --- a/src/gfilenotify.c +++ b/src/gfilenotify.c | |||
| @@ -150,6 +150,7 @@ will be reported only in case of the `moved' event. */) | |||
| 150 | GFile *gfile; | 150 | GFile *gfile; |
| 151 | GFileMonitor *monitor; | 151 | GFileMonitor *monitor; |
| 152 | GFileMonitorFlags gflags = G_FILE_MONITOR_NONE; | 152 | GFileMonitorFlags gflags = G_FILE_MONITOR_NONE; |
| 153 | GError *gerror = NULL; | ||
| 153 | 154 | ||
| 154 | /* Check parameters. */ | 155 | /* Check parameters. */ |
| 155 | CHECK_STRING (file); | 156 | CHECK_STRING (file); |
| @@ -172,7 +173,14 @@ will be reported only in case of the `moved' event. */) | |||
| 172 | gflags |= G_FILE_MONITOR_SEND_MOVED; | 173 | gflags |= G_FILE_MONITOR_SEND_MOVED; |
| 173 | 174 | ||
| 174 | /* Enable watch. */ | 175 | /* Enable watch. */ |
| 175 | monitor = g_file_monitor (gfile, gflags, NULL, NULL); | 176 | monitor = g_file_monitor (gfile, gflags, NULL, &gerror); |
| 177 | if (gerror) | ||
| 178 | { | ||
| 179 | char msg[1024]; | ||
| 180 | strcpy (msg, gerror->message); | ||
| 181 | g_error_free (gerror); | ||
| 182 | xsignal1 (Qfile_notify_error, build_string (msg)); | ||
| 183 | } | ||
| 176 | if (! monitor) | 184 | if (! monitor) |
| 177 | xsignal2 (Qfile_notify_error, build_string ("Cannot watch file"), file); | 185 | xsignal2 (Qfile_notify_error, build_string ("Cannot watch file"), file); |
| 178 | 186 | ||