Skip to content

Commit

Permalink
[Windows NIC] Removed useless error handling
Browse files Browse the repository at this point in the history
A null pointer here means "no interface", not an error.
An error is signalled by res != NO_ERROR
  • Loading branch information
daladim committed Jun 25, 2021
1 parent e29df24 commit e389f3c
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions heim-net/src/sys/windows/nic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ pub async fn nic() -> Result<impl Stream<Item = Result<Nic>> + Send + Sync> {

// Step 3 - walk through the list and populate our interfaces
let mut p_next_iface = buffer.as_ptr() as PIP_ADAPTER_ADDRESSES;
if p_next_iface.is_null() {
// Unable to list interfaces
let e = Error::from(std::io::Error::from_raw_os_error(res as _))
.with_ffi("GetAdaptersAddresses");
return Err(e);
}

let mut cur_iface;
loop {
Expand Down

0 comments on commit e389f3c

Please sign in to comment.