Revert "libmojo: Uprev the library to r456626 from Chromium"
This reverts commit 8ac9103e05b66812c25348943383f9365d1ce3e0.
Reason for revert: Broke the mac_sdk
Exempt-From-Owner-Approval: Fixing mac_sdk
Change-Id: I0b74d1abaa66933a93fd6f82ff018e8948c1204e
diff --git a/base/android/fifo_utils.cc b/base/android/fifo_utils.cc
new file mode 100644
index 0000000..8f3e95f
--- /dev/null
+++ b/base/android/fifo_utils.cc
@@ -0,0 +1,25 @@
+// Copyright 2013 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 "base/android/fifo_utils.h"
+
+#include <sys/stat.h>
+
+#include "base/files/file_path.h"
+
+namespace base {
+namespace android {
+
+bool CreateFIFO(const FilePath& path, int mode) {
+ // Default permissions for mkfifo() is ignored, chmod() is required.
+ return mkfifo(path.value().c_str(), mode) == 0 &&
+ chmod(path.value().c_str(), mode) == 0;
+}
+
+bool RedirectStream(FILE* stream, const FilePath& path, const char* mode) {
+ return freopen(path.value().c_str(), mode, stream) != NULL;
+}
+
+} // namespace android
+} // namespace base