[PATCH libpciaccess 2/2 v3] linux: Implement map_legacy
Jeremy Huddleston
jeremyhu at apple.com
Tue Oct 11 10:25:03 PDT 2011
Thanks Javier!
Pushed.
On Oct 11, 2011, at 00:46, Javier Pello wrote:
> 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 at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list