Fix inverted protection typo for mmap in region mapping.
authorEric Anholt <eric@anholt.net>
Thu, 1 Mar 2007 00:13:44 +0000 (16:13 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 1 Mar 2007 00:13:44 +0000 (16:13 -0800)
src/freebsd_pci.c

index b07dd1f..4790afb 100644 (file)
@@ -76,7 +76,7 @@ pci_device_freebsd_map( struct pci_device *dev, unsigned region,
     if ( fd == -1 )
        return errno;
 
-    prot = write_enable ? PROT_READ : (PROT_READ | PROT_WRITE);
+    prot = write_enable ? (PROT_READ | PROT_WRITE) : PROT_READ;
     dev->regions[ region ].memory = mmap( NULL, dev->regions[ region ].size,
                                          prot, MAP_SHARED, fd, 0 );