summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support/bus/linuxPci.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/os-support/bus/linuxPci.c')
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 6e33c2550..146dccfd3 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -113,14 +113,16 @@ linuxPciOpenFile(PCITAG tag)
if (fd != -1)
close(fd);
if (bus < 256) {
- if (stat("/proc/bus/pci/00", &ignored) < 0)
+ sprintf(file,"/proc/bus/pci/%02x",bus);
+ if (stat(file, &ignored) < 0)
sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
bus, dev, func);
else
sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
bus, dev, func);
} else {
- if (stat("/proc/bus/pci/00", &ignored) < 0)
+ sprintf(file,"/proc/bus/pci/%04x",bus);
+ if (stat(file, &ignored) < 0)
sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x",
bus, dev, func);
else