Merge pull request #2269 from mcharleb/uorb-posix-fix

Created px4_access to handle check of virtual files
This commit is contained in:
Lorenz Meier
2015-06-04 08:39:56 +02:00
3 changed files with 15 additions and 5 deletions
+10
View File
@@ -293,6 +293,16 @@ int px4_fsync(int fd)
return 0;
}
int px4_access(const char *pathname, int mode)
{
if (mode == F_OK) {
errno = EINVAL;
return -1;
}
VDev *dev = VDev::getDev(pathname);
return (dev != nullptr) ? 0 : -1;
}
void px4_show_devices()
{
VDev::showDevices();