diff options
| author | Michael Albinus | 2015-09-16 15:50:37 +0200 |
|---|---|---|
| committer | Michael Albinus | 2015-09-16 15:50:37 +0200 |
| commit | c762d3305cbd429606ef9f51f62b9bb3f36d00f2 (patch) | |
| tree | 309e869d65abc2fd0398d7656c30d820bf94d6c9 /src/fileio.c | |
| parent | 1636e8c75a0d4576e6ac7a246bd7a484a79ecbc2 (diff) | |
| download | emacs-c762d3305cbd429606ef9f51f62b9bb3f36d00f2.tar.gz emacs-c762d3305cbd429606ef9f51f62b9bb3f36d00f2.zip | |
Use common report_file_notify_error function
* src/fileio.c (report_file_notify_error): New function.
* src/inotify.c (report_inotify_error): Remove function.
(inotify_callback, symbol_to_inotifymask, Finotify_add_watch)
(Finotify_rm_watch): Use report_file_notify_error.
* src/lisp.h (report_file_notify_error): Declare external function.
* src/w32notify.c (report_w32notify_error): Remove function.
(Fw32notify_add_watch, Fw32notify_rm_watch):
Use report_file_notify_error.
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index d4341f8fa59..69933ccd40b 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -210,6 +210,22 @@ report_file_error (char const *string, Lisp_Object name) | |||
| 210 | report_file_errno (string, name, errno); | 210 | report_file_errno (string, name, errno); |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | /* Like report_file_error, but reports a file-notify-error instead. */ | ||
| 214 | |||
| 215 | void | ||
| 216 | report_file_notify_error (const char *string, Lisp_Object name) | ||
| 217 | { | ||
| 218 | Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name); | ||
| 219 | synchronize_system_messages_locale (); | ||
| 220 | char *str = strerror (errno); | ||
| 221 | Lisp_Object errstring | ||
| 222 | = code_convert_string_norecord (build_unibyte_string (str), | ||
| 223 | Vlocale_coding_system, 0); | ||
| 224 | Lisp_Object errdata = Fcons (errstring, data); | ||
| 225 | |||
| 226 | xsignal (Qfile_notify_error, Fcons (build_string (string), errdata)); | ||
| 227 | } | ||
| 228 | |||
| 213 | void | 229 | void |
| 214 | close_file_unwind (int fd) | 230 | close_file_unwind (int fd) |
| 215 | { | 231 | { |