Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Unified Diff: mojo/services/files/public/c/lib/mojio_fcntl.cc

Issue 1388413005: Move //mojo/services/X/public/... to //mojo/services/X/... (part 1). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/services/files/public/c/lib/mojio_fcntl.cc
diff --git a/mojo/services/files/public/c/lib/mojio_fcntl.cc b/mojo/services/files/public/c/lib/mojio_fcntl.cc
deleted file mode 100644
index 30715db58a671c95038f73ef01eaa03196669d52..0000000000000000000000000000000000000000
--- a/mojo/services/files/public/c/lib/mojio_fcntl.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015 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 "files/public/c/mojio_fcntl.h"
-
-#include <stdarg.h>
-
-#include <memory>
-#include <utility>
-
-#include "files/public/c/lib/directory_wrapper.h"
-#include "files/public/c/lib/fd_impl.h"
-#include "files/public/c/lib/fd_table.h"
-#include "files/public/c/lib/singletons.h"
-
-namespace mojio {
-namespace {
-
-int OpenImpl(const char* path, int oflag, mojio_mode_t mode) {
- DirectoryWrapper* cwd = singletons::GetCurrentWorkingDirectory();
- if (!cwd)
- return -1;
-
- std::unique_ptr<FDImpl> fd_impl(cwd->Open(path, oflag, mode));
- if (!fd_impl)
- return -1;
-
- return singletons::GetFDTable()->Add(std::move(fd_impl));
-}
-
-} // namespace
-} // namespace mojio
-
-extern "C" {
-
-int mojio_creat(const char* path, mojio_mode_t mode) {
- // This is defined by POSIX.
- return mojio::OpenImpl(path, MOJIO_O_WRONLY | MOJIO_O_CREAT | MOJIO_O_TRUNC,
- mode);
-}
-
-int mojio_open(const char* path, int oflag, ...) {
- va_list ap;
- mojio_mode_t mode = 0;
- if ((oflag & MOJIO_O_CREAT)) {
- va_start(ap, oflag);
- mode = va_arg(ap, mojio_mode_t);
- va_end(ap);
- }
- return mojio::OpenImpl(path, oflag, mode);
-}
-
-} // extern "C"
« no previous file with comments | « mojo/services/files/public/c/lib/file_fd_impl.cc ('k') | mojo/services/files/public/c/lib/mojio_sys_stat.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698