]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
sysfs: Avoid warnings when the slot address is missing.
authorMatthew Wilcox <matthew@wil.cx>
Mon, 29 Jun 2009 11:07:41 +0000 (05:07 -0600)
committerMartin Mares <mj@ucw.cz>
Mon, 29 Jun 2009 16:59:54 +0000 (18:59 +0200)
lib/sysfs.c

index 2419b414351c4293b7139251240cae97281007ff..4c2c846bad12fb5fac495b9353a7280bcce67de0 100644 (file)
@@ -221,11 +221,13 @@ sysfs_fill_slots(struct pci_access *a)
       if (n < 0 || n >= OBJNAMELEN)
        a->error("File name too long");
       file = fopen(namebuf, "r");
+      /*
+       * Old versions of Linux had a fakephp which didn't have an 'address'
+       * file.  There's no useful information to be gleaned from these
+       * devices, pretend they're not there.
+       */
       if (!file)
-       {
-         a->warning("sysfs_fill_slots: Cannot open %s: %s", namebuf, strerror(errno));
-         continue;
-       }
+       continue;
 
       if (!fgets(buf, sizeof(buf), file) || sscanf(buf, "%x:%x:%x", &dom, &bus, &dev) < 3)
        a->warning("sysfs_fill_slots: Couldn't parse entry address %s", buf);