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

Unified Diff: chrome/test/chromedriver/chrome_launcher.cc

Issue 191673003: Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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: chrome/test/chromedriver/chrome_launcher.cc
diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc
index 44a4ad822e63668607be6aa9ebbafe204a1ab11f..1ca47c355fd2158f26f974b778fe42150f25ca8a 100644
--- a/chrome/test/chromedriver/chrome_launcher.cc
+++ b/chrome/test/chromedriver/chrome_launcher.cc
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
+#include "base/files/scoped_file.h"
#include "base/format_macros.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
@@ -250,15 +251,14 @@ Status LaunchDesktopChrome(
#if defined(OS_POSIX)
base::FileHandleMappingVector no_stderr;
- int devnull = -1;
- file_util::ScopedFD scoped_devnull(&devnull);
+ base::ScopedFD devnull;
if (!CommandLine::ForCurrentProcess()->HasSwitch("verbose")) {
// Redirect stderr to /dev/null, so that Chrome log spew doesn't confuse
// users.
- devnull = open("/dev/null", O_WRONLY);
- if (devnull == -1)
+ devnull.reset(open("/dev/null", O_WRONLY));
agl 2014/03/18 06:52:05 this open should be wrapped in HANDLE_EINTR.
+ if (!devnull.is_valid())
return Status(kUnknownError, "couldn't open /dev/null");
- no_stderr.push_back(std::make_pair(devnull, STDERR_FILENO));
+ no_stderr.push_back(std::make_pair(devnull.get(), STDERR_FILENO));
options.fds_to_remap = &no_stderr;
}
#endif

Powered by Google App Engine
This is Rietveld 408576698