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

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

Issue 2540603004: [Android] Redirect std{in,out,err} to sockets for layout tests. (Closed)
Patch Set: peter comments after layout_test_android -> scoped_android_configuration Created 4 years 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
OLDNEW
(Empty)
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.
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

Powered by Google App Engine
This is Rietveld 408576698