1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/android/fifo_utils.h"
9 #include "base/files/file_path.h"
14 bool CreateFIFO(const FilePath& path, int mode) {
15 // Default permissions for mkfifo() is ignored, chmod() is required.
16 return mkfifo(path.value().c_str(), mode) == 0 &&
17 chmod(path.value().c_str(), mode) == 0;
20 bool RedirectStream(FILE* stream, const FilePath& path, const char* mode) {
21 return freopen(path.value().c_str(), mode, stream) != NULL;
24 } // namespace android