diff options
| author | Michael Albinus | 2015-08-21 11:40:38 +0200 |
|---|---|---|
| committer | Michael Albinus | 2015-08-21 11:40:38 +0200 |
| commit | 21c2b4ac52e2b1eb971e6f1e039db9108949e0eb (patch) | |
| tree | 4ff353bff030a55c03a18fe357dbf4ce3f29762d /src | |
| parent | b77bdb50ad44888d0544479f5bf74635ac9b06c1 (diff) | |
| download | emacs-21c2b4ac52e2b1eb971e6f1e039db9108949e0eb.tar.gz emacs-21c2b4ac52e2b1eb971e6f1e039db9108949e0eb.zip | |
* src/gfilenotify.c (Fgfile_add_watch):
Handle errors from g_file_monitor.
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 | ||