Repository navigation
utmpx: handle unavailable logind session metadata - #16568
mattsu2020 wants to merge 3 commits into
Conversation
35f3e69 to
73a2c08
Compare
|
GNU testsuite comparison: |
73a2c08 to
ebef859
Compare
Merging this PR will degrade performance by 42.49%3 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
|
|
||
| /// Get the login time, or the Unix epoch when it is unavailable. | ||
| /// Use [`Self::try_login_time_offset`] when displaying timestamps. | ||
| pub fn login_time_offset(&self) -> time::OffsetDateTime { |
There was a problem hiding this comment.
is this still used outside the test? looks like dead code now, same for the compat login_time()/pid()
There was a problem hiding this comment.
The compat login_time() and pid() methods are still used by UtmpxRecord
| match self { | ||
| Self::Traditional(utmpx) => utmpx.pid(), | ||
| #[cfg(all(feature = "systemd_logind", target_os = "linux"))] | ||
| Self::Traditional(utmpx) => Option::from(utmpx.pid()), |
There was a problem hiding this comment.
why Option::from and not Some(...)? looks like it is only there to dodge the clippy lint
There was a problem hiding this comment.
I updated the code to use expect.
|
Binary size comparison: |
cbb8c12 to
612d7ef
Compare
Depends on #16478. Related to #8376. Split from #11579.
Review this change.