Skip to content

Commit

Permalink
Merge pull request #5540 from keszybz/coredump-eof-fix
Browse files Browse the repository at this point in the history
coredump: fix handling of premature-eof for --backtrace
  • Loading branch information
tixxdz committed Mar 6, 2017
2 parents 7731373 + d74dc4f commit 81687ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/basic/journal-importer.c
Expand Up @@ -314,7 +314,7 @@ int journal_importer_process_data(JournalImporter *imp) {
return r;
if (r == 0) {
imp->state = IMPORTER_STATE_EOF;
return r;
return 0;
}
assert(n > 0);
assert(line[n-1] == '\n');
Expand Down
3 changes: 2 additions & 1 deletion src/coredump/coredump.c
Expand Up @@ -1326,7 +1326,8 @@ static int process_backtrace(int argc, char *argv[]) {
log_error_errno(r, "Failed to parse journal entry on stdin: %m");
goto finish;
}
if (r == 1)
if (r == 1 || /* complete entry */
journal_importer_eof(&importer)) /* end of data */
break;
}

Expand Down

0 comments on commit 81687ee

Please sign in to comment.