return flags;
}
+/* Like report_file_error, but reports a file-notify-error instead. */
+static void
+report_w32notify_error (const char *string, Lisp_Object name)
+{
+ Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name);
+ synchronize_system_messages_locale ();
+ char *str = strerror (errno);
+ Lisp_Object errstring
+ = code_convert_string_norecord (build_unibyte_string (str),
+ Vlocale_coding_system, 0);
+ Lisp_Object errdata = Fcons (errstring, data);
+
+ xsignal (Qfile_notify_error, Fcons (build_string (string), errdata));
+}
+
DEFUN ("w32notify-add-watch", Fw32notify_add_watch,
Sw32notify_add_watch, 3, 3, 0,
doc: /* Add a watch for filesystem events pertaining to FILE.
|| (w32_major_version == 5 && w32_major_version < 1))
{
errno = ENOSYS;
- report_file_error ("Watching filesystem events is not supported",
- Qnil);
+ report_w32notify_error ("Watching filesystem events is not supported",
+ Qnil);
}
/* filenotify.el always passes us a directory, either the parent
Vlocale_coding_system, 0);
else
lisp_errstr = build_string (errstr);
- report_file_error ("Cannot watch file",
- Fcons (lisp_errstr, Fcons (file, Qnil)));
+ report_w32notify_error ("Cannot watch file",
+ Fcons (lisp_errstr, Fcons (file, Qnil)));
}
else
- report_file_error ("Cannot watch file", Fcons (file, Qnil));
+ report_w32notify_error ("Cannot watch file", Fcons (file, Qnil));
}
/* Store watch object in watch list. */
watch_descriptor = make_pointer_integer (dirwatch);
}
if (status == -1)
- report_file_error ("Invalid watch descriptor", Fcons (watch_descriptor,
- Qnil));
+ report_w32notify_error ("Invalid watch descriptor", Fcons (watch_descriptor,
+ Qnil));
return Qnil;
}