@@ -41,7 +41,7 @@ use std::path::Path;
4141use std:: ptr;
4242use std:: sync:: { Mutex , MutexGuard } ;
4343
44- #[ cfg( feature = "feat_systemd_logind" ) ]
44+ #[ cfg( systemd_logind ) ]
4545use crate :: features:: systemd_logind;
4646
4747pub use self :: ut:: * ;
@@ -313,13 +313,13 @@ impl Utmpx {
313313 /// Only one instance of [`UtmpxIter`] may be active at a time. This
314314 /// function will block as long as one is still active. Beware!
315315 pub fn iter_all_records ( ) -> UtmpxIter {
316- #[ cfg( feature = "feat_systemd_logind" ) ]
316+ #[ cfg( systemd_logind ) ]
317317 {
318318 // Use systemd-logind instead of traditional utmp when feature is enabled
319319 UtmpxIter :: new_systemd ( )
320320 }
321321
322- #[ cfg( not( feature = "feat_systemd_logind" ) ) ]
322+ #[ cfg( not( systemd_logind ) ) ]
323323 {
324324 let iter = UtmpxIter :: new ( ) ;
325325 unsafe {
@@ -345,7 +345,7 @@ impl Utmpx {
345345 ///
346346 /// The same caveats as for [`Utmpx::iter_all_records`] apply.
347347 pub fn iter_all_records_from < P : AsRef < Path > > ( path : P ) -> UtmpxIter {
348- #[ cfg( feature = "feat_systemd_logind" ) ]
348+ #[ cfg( systemd_logind ) ]
349349 {
350350 // Use systemd-logind for default utmp file when feature is enabled
351351 if path. as_ref ( ) == Path :: new ( DEFAULT_FILE ) {
@@ -389,7 +389,7 @@ pub struct UtmpxIter {
389389 /// Ensure UtmpxIter is !Send. Technically redundant because MutexGuard
390390 /// is also !Send.
391391 phantom : PhantomData < std:: rc:: Rc < ( ) > > ,
392- #[ cfg( feature = "feat_systemd_logind" ) ]
392+ #[ cfg( systemd_logind ) ]
393393 systemd_iter : Option < systemd_logind:: SystemdUtmpxIter > ,
394394}
395395
@@ -402,12 +402,12 @@ impl UtmpxIter {
402402 Self {
403403 guard,
404404 phantom : PhantomData ,
405- #[ cfg( feature = "feat_systemd_logind" ) ]
405+ #[ cfg( systemd_logind ) ]
406406 systemd_iter : None ,
407407 }
408408 }
409409
410- #[ cfg( feature = "feat_systemd_logind" ) ]
410+ #[ cfg( systemd_logind ) ]
411411 fn new_systemd ( ) -> Self {
412412 // PoisonErrors can safely be ignored
413413 let guard = LOCK
@@ -432,7 +432,7 @@ impl UtmpxIter {
432432/// Wrapper type that can hold either traditional utmpx records or systemd records
433433pub enum UtmpxRecord {
434434 Traditional ( Box < Utmpx > ) ,
435- #[ cfg( feature = "feat_systemd_logind" ) ]
435+ #[ cfg( systemd_logind ) ]
436436 Systemd ( systemd_logind:: SystemdUtmpxCompat ) ,
437437}
438438
@@ -441,7 +441,7 @@ impl UtmpxRecord {
441441 pub fn record_type ( & self ) -> i16 {
442442 match self {
443443 Self :: Traditional ( utmpx) => utmpx. record_type ( ) ,
444- #[ cfg( feature = "feat_systemd_logind" ) ]
444+ #[ cfg( systemd_logind ) ]
445445 Self :: Systemd ( systemd) => systemd. record_type ( ) ,
446446 }
447447 }
@@ -450,7 +450,7 @@ impl UtmpxRecord {
450450 pub fn pid ( & self ) -> i32 {
451451 match self {
452452 Self :: Traditional ( utmpx) => utmpx. pid ( ) ,
453- #[ cfg( feature = "feat_systemd_logind" ) ]
453+ #[ cfg( systemd_logind ) ]
454454 Self :: Systemd ( systemd) => systemd. pid ( ) ,
455455 }
456456 }
@@ -459,7 +459,7 @@ impl UtmpxRecord {
459459 pub fn terminal_suffix ( & self ) -> String {
460460 match self {
461461 Self :: Traditional ( utmpx) => utmpx. terminal_suffix ( ) ,
462- #[ cfg( feature = "feat_systemd_logind" ) ]
462+ #[ cfg( systemd_logind ) ]
463463 Self :: Systemd ( systemd) => systemd. terminal_suffix ( ) ,
464464 }
465465 }
@@ -468,7 +468,7 @@ impl UtmpxRecord {
468468 pub fn user ( & self ) -> String {
469469 match self {
470470 Self :: Traditional ( utmpx) => utmpx. user ( ) ,
471- #[ cfg( feature = "feat_systemd_logind" ) ]
471+ #[ cfg( systemd_logind ) ]
472472 Self :: Systemd ( systemd) => systemd. user ( ) ,
473473 }
474474 }
@@ -477,7 +477,7 @@ impl UtmpxRecord {
477477 pub fn host ( & self ) -> String {
478478 match self {
479479 Self :: Traditional ( utmpx) => utmpx. host ( ) ,
480- #[ cfg( feature = "feat_systemd_logind" ) ]
480+ #[ cfg( systemd_logind ) ]
481481 Self :: Systemd ( systemd) => systemd. host ( ) ,
482482 }
483483 }
@@ -486,7 +486,7 @@ impl UtmpxRecord {
486486 pub fn tty_device ( & self ) -> String {
487487 match self {
488488 Self :: Traditional ( utmpx) => utmpx. tty_device ( ) ,
489- #[ cfg( feature = "feat_systemd_logind" ) ]
489+ #[ cfg( systemd_logind ) ]
490490 Self :: Systemd ( systemd) => systemd. tty_device ( ) ,
491491 }
492492 }
@@ -495,7 +495,7 @@ impl UtmpxRecord {
495495 pub fn login_time ( & self ) -> time:: OffsetDateTime {
496496 match self {
497497 Self :: Traditional ( utmpx) => utmpx. login_time ( ) ,
498- #[ cfg( feature = "feat_systemd_logind" ) ]
498+ #[ cfg( systemd_logind ) ]
499499 Self :: Systemd ( systemd) => systemd. login_time ( ) ,
500500 }
501501 }
@@ -506,7 +506,7 @@ impl UtmpxRecord {
506506 pub fn exit_status ( & self ) -> ( i16 , i16 ) {
507507 match self {
508508 Self :: Traditional ( utmpx) => utmpx. exit_status ( ) ,
509- #[ cfg( feature = "feat_systemd_logind" ) ]
509+ #[ cfg( systemd_logind ) ]
510510 Self :: Systemd ( systemd) => systemd. exit_status ( ) ,
511511 }
512512 }
@@ -515,7 +515,7 @@ impl UtmpxRecord {
515515 pub fn is_user_process ( & self ) -> bool {
516516 match self {
517517 Self :: Traditional ( utmpx) => utmpx. is_user_process ( ) ,
518- #[ cfg( feature = "feat_systemd_logind" ) ]
518+ #[ cfg( systemd_logind ) ]
519519 Self :: Systemd ( systemd) => systemd. is_user_process ( ) ,
520520 }
521521 }
@@ -524,7 +524,7 @@ impl UtmpxRecord {
524524 pub fn canon_host ( & self ) -> IOResult < String > {
525525 match self {
526526 Self :: Traditional ( utmpx) => utmpx. canon_host ( ) ,
527- #[ cfg( feature = "feat_systemd_logind" ) ]
527+ #[ cfg( systemd_logind ) ]
528528 Self :: Systemd ( systemd) => Ok ( systemd. canon_host ( ) ) ,
529529 }
530530 }
@@ -533,7 +533,7 @@ impl UtmpxRecord {
533533impl Iterator for UtmpxIter {
534534 type Item = UtmpxRecord ;
535535 fn next ( & mut self ) -> Option < Self :: Item > {
536- #[ cfg( feature = "feat_systemd_logind" ) ]
536+ #[ cfg( systemd_logind ) ]
537537 {
538538 if let Some ( ref mut systemd_iter) = self . systemd_iter {
539539 // We have a systemd iterator - use it exclusively (never fall back to traditional utmp)
0 commit comments