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

Side by Side Diff: base/android/fifo_utils.cc

Issue 16599008: Move CreateFIFO() and RedirectStream() from testing/android/ to base/android/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/android/fifo_utils.h ('k') | base/base.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #include "base/android/fifo_utils.h"
6
7 #include <sys/stat.h>
8
9 #include "base/files/file_path.h"
10
11 namespace base {
12 namespace android {
13
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;
18 }
19
20 bool RedirectStream(FILE* stream, const FilePath& path, const char* mode) {
21 return freopen(path.value().c_str(), mode, stream) != NULL;
22 }
23
24 } // namespace android
25 } // namespace base
OLDNEW
« no previous file with comments | « base/android/fifo_utils.h ('k') | base/base.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698