unix: remove unneeded SAVE_ERRNO wrappers
uv__close() won't clobber errno so there is no need to guard calls with a SAVE_ERRNO(...) wrapper. PR-URL: https://github.com/libuv/libuv/pull/837 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
322de63a9b
commit
b9324acb75
@ -1028,14 +1028,14 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
|
||||
}
|
||||
|
||||
if (ioctl(sockfd, SIOCGSIZIFCONF, &size) == -1) {
|
||||
SAVE_ERRNO(uv__close(sockfd));
|
||||
uv__close(sockfd);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
ifc.ifc_req = (struct ifreq*)uv__malloc(size);
|
||||
ifc.ifc_len = size;
|
||||
if (ioctl(sockfd, SIOCGIFCONF, &ifc) == -1) {
|
||||
SAVE_ERRNO(uv__close(sockfd));
|
||||
uv__close(sockfd);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
@ -1054,7 +1054,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
|
||||
|
||||
memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name));
|
||||
if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) {
|
||||
SAVE_ERRNO(uv__close(sockfd));
|
||||
uv__close(sockfd);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user