main: Ignore SIGPIPE when printing version
authorDan Nicholson <dbn@endlessos.org>
Tue, 27 Feb 2024 15:41:46 +0000 (08:41 -0700)
committerDan Nicholson <dbn@endlessos.org>
Tue, 27 Feb 2024 15:41:46 +0000 (08:41 -0700)
commit422a2887d7edca2103c1d068518269accb198ebb
tree365968a06b213429e085772f499a17bd64dc5c92
parent1b3ffe54e87c108b576a528efa6493f935a80f27
main: Ignore SIGPIPE when printing version

In order to do a runtime feature check, `ostree --version` can be piped
to `grep` or similar. However, if the read end of the pipe doesn't read
all of the output, `ostree` will receive `SIGPIPE` when trying to write
output. Ignore it so that `ostree` still exits successfully in that
case.
src/ostree/ot-main.c