summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-10-11 10:22:49 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-10-11 10:22:49 -0700
commitaf4478c52c960bee08209293aa14b784ac30dc05 (patch)
treee5c4284008c3be65b16690652c467697eab811fe /src
parentb9c5ce8083be53ea017bd15a63b173b4476fff23 (diff)
downloadlibpciaccess-af4478c52c960bee08209293aa14b784ac30dc05.tar.gz
libpciaccess-af4478c52c960bee08209293aa14b784ac30dc05.tar.bz2
libpciaccess-af4478c52c960bee08209293aa14b784ac30dc05.zip
linux sysfs: Fix read-write access in map_legacy
O_RDONLY | O_WRONLY != O_RDWR >< Reported-by: Javier Pello <javier.pello@urjc.es> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'src')
-rw-r--r--src/linux_sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 876abb1..d5ba66a 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -851,7 +851,7 @@ pci_device_linux_sysfs_map_legacy(struct pci_device *dev, pciaddr_t base,
int ret=0;
if (map_flags & PCI_DEV_MAP_FLAG_WRITABLE) {
- flags |= O_WRONLY;
+ flags = O_RDWR; /* O_RDWR != O_WRONLY | O_RDONLY */;
prot |= PROT_WRITE;
}