#include <stddef.h>
#include <unistd.h>
#include <sys/inotify.h>
+#include <sys/poll.h>
#include "sd-journal.h"
#include "journal-def.h"
bool found;
r = next_beyond_location(j, f, direction, &o, &p);
- if (r < 0)
- return r;
- else if (r == 0)
+ if (r < 0) {
+ log_debug("Can't iterate through %s, ignoring: %s", f->path, strerror(-r));
+ continue;
+ } else if (r == 0)
continue;
if (!new_current)
assert(filename);
if ((j->flags & SD_JOURNAL_SYSTEM_ONLY) &&
- !startswith(filename, "system.journal"))
+ !(streq(filename, "system.journal") ||
+ (startswith(filename, "system@") && endswith(filename, ".journal"))))
return 0;
if (dir)
}
}
+_public_ int sd_journal_wait(sd_journal *j, uint64_t timeout_usec) {
+ int r, k;
+
+ assert(j);
+
+ r = fd_wait_for_event(j->inotify_fd, POLLIN, timeout_usec);
+ k = sd_journal_process(j);
+
+ if (r < 0)
+ return r;
+
+ return k;
+}
+
_public_ int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from, uint64_t *to) {
Iterator i;
JournalFile *f;