rc = getFlags(fd, ifname, &ifr);
if (rc != 0)
- goto err_exit;
+ goto cleanup;
flags = (ifr.ifr_flags & flagmask) | flagset;
rc = errno;
}
-err_exit:
+cleanup:
VIR_FORCE_CLOSE(fd);
return rc;
}
_("invalid interface name %s"),
ifname);
rc = EINVAL;
- goto err_exit;
+ goto cleanup;
}
if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) {
_("coud not get MAC address of interface %s"),
ifname);
rc = errno;
- goto err_exit;
+ goto cleanup;
}
if (memcmp(&ifr.ifr_hwaddr.sa_data, macaddr, VIR_MAC_BUFLEN) != 0) {
rc = ENODEV;
- goto err_exit;
+ goto cleanup;
}
}
rc = ENODEV;
}
- err_exit:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return rc;
_("invalid interface name %s"),
ifname);
rc = EINVAL;
- goto err_exit;
+ goto cleanup;
}
if (ioctl(fd, SIOCGIFINDEX, &ifreq) >= 0)
rc = ENODEV;
}
-err_exit:
+cleanup:
VIR_FORCE_CLOSE(fd);
return rc;
if (virStrcpyStatic(vlanargs.device1, vlanifname) == NULL) {
rc = EINVAL;
- goto err_exit;
+ goto cleanup;
}
if (ioctl(fd, SIOCGIFVLAN, &vlanargs) != 0) {
rc = errno;
- goto err_exit;
+ goto cleanup;
}
*vlanid = vlanargs.u.VID;
- err_exit:
+ cleanup:
VIR_FORCE_CLOSE(fd);
return rc;
if (nlComm(nl_msg, &recvbuf, &recvbuflen, 0) < 0) {
rc = -1;
- goto err_exit;
+ goto cleanup;
}
if (recvbuflen < NLMSG_LENGTH(0) || recvbuf == NULL)
goto malformed_resp;
}
-err_exit:
+cleanup:
nlmsg_free(nl_msg);
VIR_FREE(recvbuf);
if (nlComm(nl_msg, &recvbuf, &recvbuflen, 0) < 0) {
rc = -1;
- goto err_exit;
+ goto cleanup;
}
if (recvbuflen < NLMSG_LENGTH(0) || recvbuf == NULL)
goto malformed_resp;
}
-err_exit:
+cleanup:
nlmsg_free(nl_msg);
VIR_FREE(recvbuf);
pid = getPidFunc();
if (pid == 0) {
rc = -1;
- goto err_exit;
+ goto cleanup;
}
}
if (nlComm(nl_msg, recvbuf, &recvbuflen, pid) < 0) {
rc = -1;
- goto err_exit;
+ goto cleanup;
}
if (recvbuflen < NLMSG_LENGTH(0) || *recvbuf == NULL)
if (rc != 0)
VIR_FREE(*recvbuf);
-err_exit:
+cleanup:
nlmsg_free(nl_msg);
return rc;