In lxcProcOpen() we want to check whether the /proc/memfile is
being opened only for read. For that we check the fi->flags which
correspond to flags open() call. Instead of explicitly masking
the last two bits use O_ACCMODE constant, which is deemed to be
more portable.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
if (STRNEQ(path, fuse_meminfo_path))
return -ENOENT;
- if ((fi->flags & 3) != O_RDONLY)
+ if ((fi->flags & O_ACCMODE) != O_RDONLY)
return -EACCES;
return 0;