Skip to content
Snippets Groups Projects
Commit 9c93ff15 authored by Karl Gustav Sterneberg's avatar Karl Gustav Sterneberg
Browse files

Fixed a null pointer exception.

parent a2437fad
No related branches found
No related tags found
No related merge requests found
...@@ -996,15 +996,18 @@ protected void inotify_event(int wd, int event, int cookie, string(8bit) path) ...@@ -996,15 +996,18 @@ protected void inotify_event(int wd, int event, int cookie, string(8bit) path)
// //
// Create the submonitor. // Create the submonitor.
MON_WARN("Monitor lost for path %O.\n", full_path); MON_WARN("Monitor lost for path %O.\n", full_path);
monitor(full_path, m->flags | MF_AUTO | MF_HARD, m = monitor(full_path, m->flags | MF_AUTO | MF_HARD,
m->max_dir_check_interval, m->max_dir_check_interval,
m->file_interval_factor, m->file_interval_factor,
m->stable_time); m->stable_time);
m = monitors[full_path]; // monitor() will not register monitor for path if filter_file()
// returns 0.
if (m) {
m->check(0); // Init monitor. m->check(0); // Init monitor.
} }
} }
} }
}
if (m) { if (m) {
if (event == System.Inotify.IN_IGNORED) { if (event == System.Inotify.IN_IGNORED) {
...@@ -1325,7 +1328,7 @@ protected DefaultMonitor monitor_factory(string path, MonitorFlags|void flags, ...@@ -1325,7 +1328,7 @@ protected DefaultMonitor monitor_factory(string path, MonitorFlags|void flags,
//! //!
//! @seealso //! @seealso
//! @[release()] //! @[release()]
void monitor(string path, MonitorFlags|void flags, Monitor|void monitor(string path, MonitorFlags|void flags,
int(0..)|void max_dir_check_interval, int(0..)|void max_dir_check_interval,
int(0..)|void file_interval_factor, int(0..)|void file_interval_factor,
int(0..)|void stable_time) int(0..)|void stable_time)
...@@ -1356,6 +1359,7 @@ void monitor(string path, MonitorFlags|void flags, ...@@ -1356,6 +1359,7 @@ void monitor(string path, MonitorFlags|void flags,
// NB: Registering with the monitor_queue is done as // NB: Registering with the monitor_queue is done as
// needed by register_path() as called by create(). // needed by register_path() as called by create().
} }
return m;
} }
int filter_file(string path) int filter_file(string path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment