[libvirt] [PATCH] Report correct error in virNetDevTapCreate

ioctl returns -1, not the errno value --- src/util/virnetdevtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 0b444fa..d64e64f 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -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)); -- 1.8.5.5

On 23.06.2014 13:53, Ján Tomko wrote:
ioctl returns -1, not the errno value --- src/util/virnetdevtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 0b444fa..d64e64f 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -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));
ACK Michal
participants (2)
-
Ján Tomko
-
Michal Privoznik