Skip to content

Commit 320528e

Browse files
Prevent exceptions with a 'Success' message when there is a problem with permissions (#78555)
1 parent 1ca454e commit 320528e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static unsafe partial int EnumerateInterfaceAddresses(
5252
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")]
5353
public static unsafe partial int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged<void*, IpAddressInfo*, void> onGatewayFound);
5454

55-
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")]
55+
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces", SetLastError = true)]
5656
public static unsafe partial int GetNetworkInterfaces(int* count, NetworkInterfaceInfo** addrs, int* addressCount, IpAddressInfo** aa);
5757

5858
}

src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public enum NetworkChangeKind
1616
AvailabilityChanged = 2
1717
}
1818

19-
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")]
19+
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket", SetLastError = true)]
2020
public static unsafe partial Error CreateNetworkChangeListenerSocket(IntPtr* socket);
2121

2222
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")]

0 commit comments

Comments
 (0)