コード例 #1
0
ファイル: connection.cpp プロジェクト: saltstar/smartnix
// Performs a path walk and opens a connection to another node.
void OpenAt(Vfs* vfs, fbl::RefPtr<Vnode> parent, zx::channel channel,
            fbl::StringPiece path, uint32_t flags, uint32_t mode) {
    bool describe;
    uint32_t open_flags;
    FilterFlags(flags, &open_flags, &describe);

    fbl::RefPtr<Vnode> vnode;
    zx_status_t r = vfs->Open(std::move(parent), &vnode, path, &path, open_flags, mode);

    if (r != ZX_OK) {
        FS_TRACE_DEBUG("vfs: open failure: %d\n", r);
    } else if (!(open_flags & ZX_FS_FLAG_NOREMOTE) && vnode->IsRemote()) {
        // Remote handoff to a remote filesystem node.
        vfs->ForwardOpenRemote(std::move(vnode), std::move(channel), std::move(path),
                               flags, mode);
        return;
    }

    if (describe) {
        // Regardless of the error code, in the 'describe' case, we
        // should respond to the client.
        if (r != ZX_OK) {
            WriteDescribeError(std::move(channel), r);
            return;
        }

        OnOpenMsg response;
        memset(&response, 0, sizeof(response));
        zx_handle_t extra = ZX_HANDLE_INVALID;
        Describe(vnode, flags, &response, &extra);
        uint32_t hcount = (extra != ZX_HANDLE_INVALID) ? 1 : 0;
        channel.write(0, &response, sizeof(OnOpenMsg), &extra, hcount);
    } else if (r != ZX_OK) {
        return;
    }

    VnodeServe(vfs, std::move(vnode), std::move(channel), open_flags);
}
コード例 #2
0
QgsSearchWidgetWrapper::FilterFlags QgsSearchWidgetWrapper::defaultFlags() const
{
  return FilterFlags();
}