]> xenbits.xensource.com Git - libvirt.git/commitdiff
Do not save errno in virUSBDeviceSearch
authorJán Tomko <jtomko@redhat.com>
Tue, 21 Jun 2016 11:19:19 +0000 (13:19 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 23 Jun 2016 19:37:32 +0000 (21:37 +0200)
The virUSBDeviceFind* callers do not check errno after calling
this function.

src/util/virusb.c

index 520610baa0bc4283f5ca87d3116b16be0a437e1b..5c39667920390a7aa17bb4e2862171ff9895db90 100644 (file)
@@ -202,11 +202,8 @@ virUSBDeviceSearch(unsigned int vendor,
     ret = list;
 
  cleanup:
-    if (dir) {
-        int saved_errno = errno;
+    if (dir)
         closedir(dir);
-        errno = saved_errno;
-    }
 
     if (!ret)
         virObjectUnref(list);