Skip to content

Commit

Permalink
fix: do not fail on invalid JOURNAL_STREAM content
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth committed Mar 27, 2021
1 parent 7a1b9a7 commit 0ce748e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/systemd.erl
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ get_journal_stream() ->
Env = os:getenv("JOURNAL_STREAM", ""),
case string:split(Env, ":") of
[DevStr, InodeStr | _] ->
{list_to_integer(DevStr), list_to_integer(InodeStr)};
try {list_to_integer(DevStr), list_to_integer(InodeStr)}
catch error:badarg:_ -> error
end;
_ -> error
end.

Expand Down

0 comments on commit 0ce748e

Please sign in to comment.