On Fri, 2011-10-07 at 10:18:20 -0700, Jeremy Huddleston wrote: > + char name[PATH_MAX]; > + int flags = O_RDONLY; > + int prot = PROT_READ; > + int fd; > + int ret=0; > + > + if (map_flags & PCI_DEV_MAP_FLAG_WRITABLE) { > + flags |= O_WRONLY; > + prot |= PROT_WRITE; > + }
This won't do what you want. Linux has #define O_ACCMODE 00000003 #define O_RDONLY 00000000 #define O_WRONLY 00000001 #define O_RDWR 00000002 in asm-generic/fcntl.h, so O_RDONLY | O_WRONLY != O_RDWR. I think you should just say flags = O_RDWR in the conditional. Javier _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel