px4_posix.h: avoid defining PX4_F_RDONLY as O_RDONLY

- There is an assumption un uORB that PX4_F_RDONLY is not 0.
- But O_RDONLY is 0 on Linux. orb_exists passes 0 to px4_open, which in
  uORB::DeviceNode::open leads to an unnecessary allocation of
  SubscriberData()
- PX4_F_RDONLY is only used in combination with px4_open, never with open()

However even if it was wrong/unexpected, it did not cause any problems,
just the unnecessary allocation.
This commit is contained in:
Beat Küng
2018-07-13 11:30:23 +02:00
committed by Lorenz Meier
parent ab788ceba7
commit 5e3e486527
2 changed files with 3 additions and 7 deletions
@@ -162,7 +162,7 @@ extern "C" {
int i;
mode_t mode;
if (!dev && (flags & (PX4_F_WRONLY | PX4_F_CREAT)) != 0 &&
if (!dev && (flags & PX4_F_WRONLY) != 0 &&
strncmp(path, "/obj/", 5) != 0 &&
strncmp(path, "/dev/", 5) != 0) {
va_list p;