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) {
|
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 */
|
||||||
@ -192,9 +193,10 @@ 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)
|
|
||||||
return 0;
|
if (!m->follow)
|
||||||
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);
|
||||||
@ -203,20 +205,21 @@ 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 (m->follow) {
|
if (wait_for_events) {
|
||||||
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");
|
||||||
return MHD_CONTENT_READER_END_WITH_ERROR;
|
return MHD_CONTENT_READER_END_WITH_ERROR;
|
||||||
}
|
|
||||||
if (r == SD_JOURNAL_NOP)
|
|
||||||
break;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
if (r == SD_JOURNAL_NOP)
|
||||||
|
break;
|
||||||
|
|
||||||
return MHD_CONTENT_READER_END_OF_STREAM;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->discrete) {
|
if (m->discrete) {
|
||||||
|
@ -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 = path.rglob('*.json')
|
hwid_files = sorted(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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user