mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
journalctl: properly track rotated journals in follow mode
This commit is contained in:
parent
44a5fa34d9
commit
5e6870eab5
@ -1333,7 +1333,7 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
|
||||
|
||||
m->wd = inotify_add_watch(j->inotify_fd, m->path,
|
||||
IN_CREATE|IN_MOVED_TO|IN_MODIFY|IN_ATTRIB|IN_DELETE|
|
||||
IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|
|
||||
IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_MOVED_FROM|
|
||||
IN_ONLYDIR);
|
||||
|
||||
if (m->wd > 0 && hashmap_put(j->directories_by_wd, INT_TO_PTR(m->wd), m) < 0)
|
||||
@ -1951,7 +1951,7 @@ static void process_inotify_event(sd_journal *j, struct inotify_event *e) {
|
||||
if (r < 0)
|
||||
log_debug("Failed to add file %s/%s: %s", d->path, e->name, strerror(-r));
|
||||
|
||||
} else if (e->mask & (IN_DELETE|IN_UNMOUNT)) {
|
||||
} else if (e->mask & (IN_DELETE|IN_MOVED_FROM|IN_UNMOUNT)) {
|
||||
|
||||
r = remove_file(j, d->path, e->name);
|
||||
if (r < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user