Skip to content

Commit 17122c3

Browse files
committed
sd-journal: don't treat invalid match as a programming error
Don't use assert_runtime() when we get an invalid match string, since that's a runtime error: $ SYSTEMD_LOG_LEVEL=debug coredumpctl info = ... Adding match: = Assertion 'match_is_valid(data, size)' failed at src/libsystemd/sd-journal/sd-journal.c:240, function sd_journal_add_match(). Ignoring. Failed to add match "=": Invalid argument
1 parent a3d3bf5 commit 17122c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libsystemd/sd-journal/sd-journal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ _public_ int sd_journal_add_match(sd_journal *j, const void *data, size_t size)
235235
if (size == 0)
236236
size = strlen(data);
237237

238-
assert_return(match_is_valid(data, size), -EINVAL);
238+
if (!match_is_valid(data, size))
239+
return -EINVAL;
239240

240241
/* level 0: AND term
241242
* level 1: OR terms

0 commit comments

Comments
 (0)