@@ -601,12 +601,6 @@ int32_t SystemNative_GetHostEntryForNameAsync(const uint8_t* address, int32_t ad
601
601
return GetAddrInfoErrorFlags_EAI_BADARG ;
602
602
}
603
603
604
- sa_family_t platformFamily ;
605
- if (!TryConvertAddressFamilyPalToPlatform (addressFamily , & platformFamily ))
606
- {
607
- return GetAddrInfoErrorFlags_EAI_FAMILY ;
608
- }
609
-
610
604
struct GetAddrInfoAsyncState * state = malloc (sizeof (* state ) + addrlen + 1 );
611
605
612
606
if (state == NULL )
@@ -622,24 +616,22 @@ int32_t SystemNative_GetHostEntryForNameAsync(const uint8_t* address, int32_t ad
622
616
623
617
memcpy (state -> address , address , addrlen + 1 );
624
618
625
- * state = (struct GetAddrInfoAsyncState ) {
626
- .gai_request = {
627
- .ar_name = state -> address ,
628
- .ar_service = NULL ,
629
- .ar_request = & state -> hint ,
630
- .ar_result = NULL
631
- },
632
- .gai_requests = & state -> gai_request ,
633
- .sigevent = {
634
- .sigev_notify = SIGEV_THREAD ,
635
- .sigev_value = {
636
- .sival_ptr = state
637
- },
638
- .sigev_notify_function = GetHostEntryForNameAsyncComplete
619
+ state -> gai_request = (struct gaicb ) {
620
+ .ar_name = state -> address ,
621
+ .ar_service = NULL ,
622
+ .ar_request = & state -> hint ,
623
+ .ar_result = NULL
624
+ };
625
+ state -> gai_requests = & state -> gai_request ;
626
+ state -> sigevent = (struct sigevent ) {
627
+ .sigev_notify = SIGEV_THREAD ,
628
+ .sigev_value = {
629
+ .sival_ptr = state
639
630
},
640
- .entry = entry ,
641
- .callback = callback
631
+ .sigev_notify_function = GetHostEntryForNameAsyncComplete
642
632
};
633
+ state -> entry = entry ;
634
+ state -> callback = callback ;
643
635
644
636
atomic_thread_fence (memory_order_release );
645
637
0 commit comments