]> git.ipfire.org Git - thirdparty/systemd.git/commit
journalcl: simplify handling of stdout being a regular file and epoll()
authorLennart Poettering <lennart@poettering.net>
Thu, 10 Aug 2023 12:47:12 +0000 (14:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 10 Aug 2023 13:01:48 +0000 (15:01 +0200)
commit9050632ec05ec6874dd0c06bcf842ebe30d5d989
tree401a637f5066abd9c32e74625b00bbb2a902347f
parente5e900edcd3b245499379201072cbb69346e9798
journalcl: simplify handling of stdout being a regular file and epoll()

Let's not check the fd type beforehand, let's instead gracefully handle
if we get EPERM back from epoll_ctl() because the fd doesn't do epoll.
THis should be safer and more generic.

The epoll_ctl(2) man page clearly documents EPERM is being returned in
this case, hence it's safe to check for exactly that case.

Follow-up for: #28644
src/journal/journalctl.c