@@ -438,13 +438,6 @@ s_no_extra_traits! {
438438 pub __reserved: [ c_char; 256 ] ,
439439 }
440440
441- // FIXME(musl): musl added paddings and adjusted
442- // layout in 1.2.0 but our CI is still 1.1.24.
443- // So, I'm leaving some fields as cfg for now.
444- // ref. https://github.com/bminor/musl/commit/
445- // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392
446- //
447- // OpenHarmony uses the musl 1.2 layout.
448441 pub struct utmpx {
449442 pub ut_type: c_short,
450443 __ut_pad1: c_short,
@@ -455,31 +448,24 @@ s_no_extra_traits! {
455448 pub ut_host: [ c_char; 256 ] ,
456449 pub ut_exit: __exit_status,
457450
458- #[ cfg( target_env = "musl" ) ]
459- #[ cfg( not( target_arch = "loongarch64" ) ) ]
451+ #[ cfg( not( musl_v1_2_3) ) ]
452+ #[ deprecated(
453+ since = "0.2.173" ,
454+ note = "The ABI of this field has changed from c_long to c_int with padding, \
455+ we'll follow that change in the future release. See #4443 for more info."
456+ ) ]
460457 pub ut_session: c_long,
461458
462- #[ cfg( target_env = "musl" ) ]
463- #[ cfg( target_arch = "loongarch64" ) ]
464- pub ut_session: c_int,
465-
466- #[ cfg( target_env = "musl" ) ]
467- #[ cfg( target_arch = "loongarch64" ) ]
459+ #[ cfg( musl_v1_2_3) ]
460+ #[ cfg( not( target_endian = "little" ) ) ]
468461 __ut_pad2: c_int,
469462
470- #[ cfg( target_env = "ohos" ) ]
471- #[ cfg( target_endian = "little" ) ]
463+ #[ cfg( musl_v1_2_3) ]
472464 pub ut_session: c_int,
473- #[ cfg( target_env = "ohos" ) ]
474- #[ cfg( target_endian = "little" ) ]
475- __ut_pad2: c_int,
476465
477- #[ cfg( target_env = "ohos" ) ]
478- #[ cfg( not ( target_endian = "little" ) ) ]
466+ #[ cfg( musl_v1_2_3 ) ]
467+ #[ cfg( target_endian = "little" ) ]
479468 __ut_pad2: c_int,
480- #[ cfg( target_env = "ohos" ) ]
481- #[ cfg( not( target_endian = "little" ) ) ]
482- pub ut_session: c_int,
483469
484470 pub ut_tv: crate :: timeval,
485471 pub ut_addr_v6: [ c_uint; 4 ] ,
@@ -555,6 +541,7 @@ cfg_if! {
555541 }
556542
557543 impl PartialEq for utmpx {
544+ #[ allow( deprecated) ]
558545 fn eq( & self , other: & utmpx) -> bool {
559546 self . ut_type == other. ut_type
560547 //&& self.__ut_pad1 == other.__ut_pad1
@@ -579,6 +566,7 @@ cfg_if! {
579566 impl Eq for utmpx { }
580567
581568 impl fmt:: Debug for utmpx {
569+ #[ allow( deprecated) ]
582570 fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
583571 f. debug_struct( "utmpx" )
584572 . field( "ut_type" , & self . ut_type)
@@ -599,6 +587,7 @@ cfg_if! {
599587 }
600588
601589 impl hash:: Hash for utmpx {
590+ #[ allow( deprecated) ]
602591 fn hash<H : hash:: Hasher >( & self , state: & mut H ) {
603592 self . ut_type. hash( state) ;
604593 //self.__ut_pad1.hash(state);
0 commit comments