Report correct error in virNetDevTapCreate

ioctl returns -1, not the errno value
This commit is contained in:
Ján Tomko 2014-06-23 12:03:05 +02:00
parent 10af0a1973
commit f8a33815d0

View File

@ -294,7 +294,7 @@ int virNetDevTapCreate(char **ifname,
}
if ((flags & VIR_NETDEV_TAP_CREATE_PERSIST) &&
(errno = ioctl(fd, TUNSETPERSIST, 1))) {
ioctl(fd, TUNSETPERSIST, 1) < 0) {
virReportSystemError(errno,
_("Unable to set tap device %s to persistent"),
NULLSTR(*ifname));