(void)mode; (void)flags;
if (!*path)
{
- *f = this;
+ *f = cxx::ref_ptr(this);
return 0;
}
return -ENOENT;
// FIXME: should check if it is a dataspace, somehow
- L4Re::Vfs::File *fi = 0;
+ cxx::Ref_ptr<L4Re::Vfs::File> fi;
L4::Cap<L4Re::Namespace> nsc
= L4::cap_dynamic_cast<L4Re::Namespace>(file.get());
if (!nsc.is_valid())
- fi = new Ro_file(file.get());
+ fi = cxx::ref_ptr(new Ro_file(file.get()));
else // use mat protocol here!!
- fi = new Ns_dir(nsc);
+ fi = cxx::ref_ptr(new Ns_dir(nsc));
if (!fi)
return -ENOMEM;
file.release();
- *f = fi;
+ *f = cxx::move(fi);
return 0;
}
(void)mode; (void)flags;
if (!*path)
{
- *f = this;
+ *f = cxx::ref_ptr(this);
return 0;
}
return -ENOENT;
// FIXME: should check if it is a dataspace, somehow
- L4Re::Vfs::File *fi = 0;
+ cxx::Ref_ptr<L4Re::Vfs::File> fi;
L4::Cap<L4Re::Namespace> nsc
= L4::cap_dynamic_cast<L4Re::Namespace>(file.get());
if (!nsc.is_valid())
- fi = new Ro_file(file.get());
+ fi = cxx::ref_ptr(new Ro_file(file.get()));
else // use mat protocol here!!
- fi = new Ns_dir(nsc);
+ fi = cxx::ref_ptr(new Ns_dir(nsc));
if (!fi)
return -ENOMEM;
file.release();
- *f = fi;
+ *f = cxx::move(fi);
return 0;
}
memcpy(d->d_name, _current_cap_entry->name, l);
d->d_name[l - 1] = 0;
d->d_reclen = n;
- if (check_type(_current_cap_entry, L4Re::Protocol::Namespace))
+ if (check_type(_current_cap_entry, L4Re::Namespace::Protocol))
d->d_type = DT_DIR;
- else if (check_type(_current_cap_entry, L4Re::Protocol::Dataspace))
+ else if (check_type(_current_cap_entry, L4Re::Dataspace::Protocol))
d->d_type = DT_REG;
else
d->d_type = DT_UNKNOWN;