mirror of
https://github.com/systemd/systemd
synced 2025-10-03 18:54:45 +02:00
Compare commits
2 Commits
827ef318ec
...
db8b91980b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
db8b91980b | ||
![]() |
3ddb2ee172 |
@ -172,6 +172,7 @@ static ssize_t request_reader_entries(
|
||||
|
||||
while (pos >= m->size) {
|
||||
off_t sz;
|
||||
bool wait_for_events = false;
|
||||
|
||||
/* End of this entry, so let's serialize the next
|
||||
* one */
|
||||
@ -192,9 +193,10 @@ static ssize_t request_reader_entries(
|
||||
* from it are not returned. */
|
||||
if (r < m->n_skip + 1) {
|
||||
m->n_skip -= r;
|
||||
if (m->follow)
|
||||
return 0;
|
||||
|
||||
if (!m->follow)
|
||||
return MHD_CONTENT_READER_END_OF_STREAM;
|
||||
wait_for_events = true;
|
||||
}
|
||||
} else
|
||||
r = sd_journal_next(m->journal);
|
||||
@ -203,8 +205,12 @@ static ssize_t request_reader_entries(
|
||||
log_error_errno(r, "Failed to advance journal pointer: %m");
|
||||
return MHD_CONTENT_READER_END_WITH_ERROR;
|
||||
} else if (r == 0) {
|
||||
if (!m->follow)
|
||||
return MHD_CONTENT_READER_END_OF_STREAM;
|
||||
wait_for_events = true;
|
||||
}
|
||||
|
||||
if (m->follow) {
|
||||
if (wait_for_events) {
|
||||
r = sd_journal_wait(m->journal, (uint64_t) JOURNAL_WAIT_TIMEOUT);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Couldn't wait for journal event: %m");
|
||||
@ -216,9 +222,6 @@ static ssize_t request_reader_entries(
|
||||
continue;
|
||||
}
|
||||
|
||||
return MHD_CONTENT_READER_END_OF_STREAM;
|
||||
}
|
||||
|
||||
if (m->discrete) {
|
||||
assert(m->cursor);
|
||||
|
||||
|
@ -1184,7 +1184,7 @@ def pack_strings(strings: set[str], base: int) -> tuple[bytes, dict[str, int]]:
|
||||
|
||||
|
||||
def parse_hwid_dir(path: Path) -> bytes:
|
||||
hwid_files = path.rglob('*.json')
|
||||
hwid_files = sorted(path.rglob('*.json'))
|
||||
devstr_to_type: dict[str, int] = {
|
||||
'devicetree': DEVICE_TYPE_DEVICETREE,
|
||||
'uefi-fw': DEVICE_TYPE_UEFI_FW,
|
||||
|
Loading…
x
Reference in New Issue
Block a user