1
0
mirror of https://github.com/systemd/systemd synced 2025-10-04 03:04:44 +02:00

Compare commits

..

No commits in common. "db8b91980b9914564224fec1566f60c2961c6dc8" and "827ef318ec27a2c3c753614e89218b2a7d205937" have entirely different histories.

2 changed files with 15 additions and 18 deletions

View File

@ -172,7 +172,6 @@ static ssize_t request_reader_entries(
while (pos >= m->size) { while (pos >= m->size) {
off_t sz; off_t sz;
bool wait_for_events = false;
/* End of this entry, so let's serialize the next /* End of this entry, so let's serialize the next
* one */ * one */
@ -193,10 +192,9 @@ static ssize_t request_reader_entries(
* from it are not returned. */ * from it are not returned. */
if (r < m->n_skip + 1) { if (r < m->n_skip + 1) {
m->n_skip -= r; m->n_skip -= r;
if (m->follow)
if (!m->follow) return 0;
return MHD_CONTENT_READER_END_OF_STREAM; return MHD_CONTENT_READER_END_OF_STREAM;
wait_for_events = true;
} }
} else } else
r = sd_journal_next(m->journal); r = sd_journal_next(m->journal);
@ -205,12 +203,8 @@ static ssize_t request_reader_entries(
log_error_errno(r, "Failed to advance journal pointer: %m"); log_error_errno(r, "Failed to advance journal pointer: %m");
return MHD_CONTENT_READER_END_WITH_ERROR; return MHD_CONTENT_READER_END_WITH_ERROR;
} else if (r == 0) { } else if (r == 0) {
if (!m->follow)
return MHD_CONTENT_READER_END_OF_STREAM;
wait_for_events = true;
}
if (wait_for_events) { if (m->follow) {
r = sd_journal_wait(m->journal, (uint64_t) JOURNAL_WAIT_TIMEOUT); r = sd_journal_wait(m->journal, (uint64_t) JOURNAL_WAIT_TIMEOUT);
if (r < 0) { if (r < 0) {
log_error_errno(r, "Couldn't wait for journal event: %m"); log_error_errno(r, "Couldn't wait for journal event: %m");
@ -222,6 +216,9 @@ static ssize_t request_reader_entries(
continue; continue;
} }
return MHD_CONTENT_READER_END_OF_STREAM;
}
if (m->discrete) { if (m->discrete) {
assert(m->cursor); assert(m->cursor);

View File

@ -1184,7 +1184,7 @@ def pack_strings(strings: set[str], base: int) -> tuple[bytes, dict[str, int]]:
def parse_hwid_dir(path: Path) -> bytes: def parse_hwid_dir(path: Path) -> bytes:
hwid_files = sorted(path.rglob('*.json')) hwid_files = path.rglob('*.json')
devstr_to_type: dict[str, int] = { devstr_to_type: dict[str, int] = {
'devicetree': DEVICE_TYPE_DEVICETREE, 'devicetree': DEVICE_TYPE_DEVICETREE,
'uefi-fw': DEVICE_TYPE_UEFI_FW, 'uefi-fw': DEVICE_TYPE_UEFI_FW,