Merge pull request #5540 from keszybz/coredump-eof-fix
coredump: fix handling of premature-eof for --backtrace
This commit is contained in:
commit
81687ee338
|
@ -314,7 +314,7 @@ int journal_importer_process_data(JournalImporter *imp) {
|
||||||
return r;
|
return r;
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
imp->state = IMPORTER_STATE_EOF;
|
imp->state = IMPORTER_STATE_EOF;
|
||||||
return r;
|
return 0;
|
||||||
}
|
}
|
||||||
assert(n > 0);
|
assert(n > 0);
|
||||||
assert(line[n-1] == '\n');
|
assert(line[n-1] == '\n');
|
||||||
|
|
|
@ -1326,7 +1326,8 @@ static int process_backtrace(int argc, char *argv[]) {
|
||||||
log_error_errno(r, "Failed to parse journal entry on stdin: %m");
|
log_error_errno(r, "Failed to parse journal entry on stdin: %m");
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
if (r == 1)
|
if (r == 1 || /* complete entry */
|
||||||
|
journal_importer_eof(&importer)) /* end of data */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue