blob: 0c62ba8e201768894ace705b516c8dce89917c31 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/public/cpp/system/watcher.h"
#include "mojo/public/c/system/functions.h"
namespace mojo {
MojoResult CreateWatcher(MojoWatcherCallback callback,
ScopedWatcherHandle* watcher_handle) {
MojoHandle handle;
MojoResult rv = MojoCreateWatcher(callback, &handle);
if (rv == MOJO_RESULT_OK)
watcher_handle->reset(WatcherHandle(handle));
return rv;
}
} // namespace mojo