@@ -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
@@ -400,12 +400,12 @@ impl UtmpxIter {
400400 Self {
401401 guard,
402402 phantom : PhantomData ,
403- #[ cfg( feature = "feat_systemd_logind" ) ]
403+ #[ cfg( systemd_logind ) ]
404404 systemd_iter : None ,
405405 }
406406 }
407407
408- #[ cfg( feature = "feat_systemd_logind" ) ]
408+ #[ cfg( systemd_logind ) ]
409409 fn new_systemd ( ) -> Self {
410410 // PoisonErrors can safely be ignored
411411 let guard = LOCK . lock ( ) . unwrap_or_else ( |err| err. into_inner ( ) ) ;
@@ -428,7 +428,7 @@ impl UtmpxIter {
428428/// Wrapper type that can hold either traditional utmpx records or systemd records
429429pub enum UtmpxRecord {
430430 Traditional ( Box < Utmpx > ) ,
431- #[ cfg( feature = "feat_systemd_logind" ) ]
431+ #[ cfg( systemd_logind ) ]
432432 Systemd ( systemd_logind:: SystemdUtmpxCompat ) ,
433433}
434434
@@ -437,7 +437,7 @@ impl UtmpxRecord {
437437 pub fn record_type ( & self ) -> i16 {
438438 match self {
439439 Self :: Traditional ( utmpx) => utmpx. record_type ( ) ,
440- #[ cfg( feature = "feat_systemd_logind" ) ]
440+ #[ cfg( systemd_logind ) ]
441441 Self :: Systemd ( systemd) => systemd. record_type ( ) ,
442442 }
443443 }
@@ -446,7 +446,7 @@ impl UtmpxRecord {
446446 pub fn pid ( & self ) -> i32 {
447447 match self {
448448 Self :: Traditional ( utmpx) => utmpx. pid ( ) ,
449- #[ cfg( feature = "feat_systemd_logind" ) ]
449+ #[ cfg( systemd_logind ) ]
450450 Self :: Systemd ( systemd) => systemd. pid ( ) ,
451451 }
452452 }
@@ -455,7 +455,7 @@ impl UtmpxRecord {
455455 pub fn terminal_suffix ( & self ) -> String {
456456 match self {
457457 Self :: Traditional ( utmpx) => utmpx. terminal_suffix ( ) ,
458- #[ cfg( feature = "feat_systemd_logind" ) ]
458+ #[ cfg( systemd_logind ) ]
459459 Self :: Systemd ( systemd) => systemd. terminal_suffix ( ) ,
460460 }
461461 }
@@ -464,7 +464,7 @@ impl UtmpxRecord {
464464 pub fn user ( & self ) -> String {
465465 match self {
466466 Self :: Traditional ( utmpx) => utmpx. user ( ) ,
467- #[ cfg( feature = "feat_systemd_logind" ) ]
467+ #[ cfg( systemd_logind ) ]
468468 Self :: Systemd ( systemd) => systemd. user ( ) ,
469469 }
470470 }
@@ -473,7 +473,7 @@ impl UtmpxRecord {
473473 pub fn host ( & self ) -> String {
474474 match self {
475475 Self :: Traditional ( utmpx) => utmpx. host ( ) ,
476- #[ cfg( feature = "feat_systemd_logind" ) ]
476+ #[ cfg( systemd_logind ) ]
477477 Self :: Systemd ( systemd) => systemd. host ( ) ,
478478 }
479479 }
@@ -482,7 +482,7 @@ impl UtmpxRecord {
482482 pub fn tty_device ( & self ) -> String {
483483 match self {
484484 Self :: Traditional ( utmpx) => utmpx. tty_device ( ) ,
485- #[ cfg( feature = "feat_systemd_logind" ) ]
485+ #[ cfg( systemd_logind ) ]
486486 Self :: Systemd ( systemd) => systemd. tty_device ( ) ,
487487 }
488488 }
@@ -491,7 +491,7 @@ impl UtmpxRecord {
491491 pub fn login_time ( & self ) -> time:: OffsetDateTime {
492492 match self {
493493 Self :: Traditional ( utmpx) => utmpx. login_time ( ) ,
494- #[ cfg( feature = "feat_systemd_logind" ) ]
494+ #[ cfg( systemd_logind ) ]
495495 Self :: Systemd ( systemd) => systemd. login_time ( ) ,
496496 }
497497 }
@@ -502,7 +502,7 @@ impl UtmpxRecord {
502502 pub fn exit_status ( & self ) -> ( i16 , i16 ) {
503503 match self {
504504 Self :: Traditional ( utmpx) => utmpx. exit_status ( ) ,
505- #[ cfg( feature = "feat_systemd_logind" ) ]
505+ #[ cfg( systemd_logind ) ]
506506 Self :: Systemd ( systemd) => systemd. exit_status ( ) ,
507507 }
508508 }
@@ -511,7 +511,7 @@ impl UtmpxRecord {
511511 pub fn is_user_process ( & self ) -> bool {
512512 match self {
513513 Self :: Traditional ( utmpx) => utmpx. is_user_process ( ) ,
514- #[ cfg( feature = "feat_systemd_logind" ) ]
514+ #[ cfg( systemd_logind ) ]
515515 Self :: Systemd ( systemd) => systemd. is_user_process ( ) ,
516516 }
517517 }
@@ -520,7 +520,7 @@ impl UtmpxRecord {
520520 pub fn canon_host ( & self ) -> IOResult < String > {
521521 match self {
522522 Self :: Traditional ( utmpx) => utmpx. canon_host ( ) ,
523- #[ cfg( feature = "feat_systemd_logind" ) ]
523+ #[ cfg( systemd_logind ) ]
524524 Self :: Systemd ( systemd) => systemd. canon_host ( ) ,
525525 }
526526 }
@@ -529,7 +529,7 @@ impl UtmpxRecord {
529529impl Iterator for UtmpxIter {
530530 type Item = UtmpxRecord ;
531531 fn next ( & mut self ) -> Option < Self :: Item > {
532- #[ cfg( feature = "feat_systemd_logind" ) ]
532+ #[ cfg( systemd_logind ) ]
533533 {
534534 if let Some ( ref mut systemd_iter) = self . systemd_iter {
535535 // We have a systemd iterator - use it exclusively (never fall back to traditional utmp)
0 commit comments