]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Report correct error in virNetDevTapCreate
authorJán Tomko <jtomko@redhat.com>
Mon, 23 Jun 2014 10:03:05 +0000 (12:03 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 23 Jun 2014 12:16:23 +0000 (14:16 +0200)
ioctl returns -1, not the errno value

src/util/virnetdevtap.c

index 0b444fad39627481b96b83cb539fa3a5f7e80f5f..d64e64fc498b91ba4fe3bd69ac05d5d32ffc06b1 100644 (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));