summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-remote-parse.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-17 09:27:30 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-31 13:04:18 +0200
commite743ce7053bdeb0b15220f7d842eb48d6721e48b (patch)
tree2eae1adbfa233d1c61ac441408af1b8da6af2942 /src/journal-remote/journal-remote-parse.c
parent41b0b1274d34db1605fb78c1c82e420d7e742f6e (diff)
downloadsystemd-e743ce7053bdeb0b15220f7d842eb48d6721e48b.tar.gz
journal-remote: when an entry is rejected with -EBADMSG, do not rotate the journal file
Something is wrong with the entry (probably a missing timestamp), so no point in rotating. But suppress the error in process_source(), so that the processing of the data stream continues. Also, just return 0 from writer_write() on success, the only caller doesn't care.
Diffstat (limited to 'src/journal-remote/journal-remote-parse.c')
-rw-r--r--src/journal-remote/journal-remote-parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c
index 6a194e7f9f..645bd7b4cf 100644
--- a/src/journal-remote/journal-remote-parse.c
+++ b/src/journal-remote/journal-remote-parse.c
@@ -32,7 +32,6 @@ void source_free(RemoteSource *source) {
* ownership of fd, name, and writer, otherwise does not touch them.
*/
RemoteSource* source_new(int fd, bool passive_fd, char *name, Writer *writer) {
-
RemoteSource *source;
log_debug("Creating source for %sfd:%d (%s)",
@@ -75,7 +74,10 @@ int process_source(RemoteSource *source, bool compress, bool seal) {
assert(source->importer.iovw.iovec);
r = writer_write(source->writer, &source->importer.iovw, &source->importer.ts, compress, seal);
- if (r < 0)
+ if (r == -EBADMSG) {
+ log_error_errno(r, "Entry is invalid, ignoring.");
+ r = 0;
+ } else if (r < 0)
log_error_errno(r, "Failed to write entry of %zu bytes: %m",
iovw_size(&source->importer.iovw));
else