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

Unified Diff: base/process/launch_posix.cc

Issue 197873014: Revert of 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
« no previous file with comments | « base/process/kill_posix.cc ('k') | base/test/launcher/test_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/launch_posix.cc
diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
index 79e74d5877dbd5baa856729555ee707925f393b6..84a05d61105e9b0cd4980fb66724e09a3887c3ae 100644
--- a/base/process/launch_posix.cc
+++ b/base/process/launch_posix.cc
@@ -26,7 +26,6 @@
#include "base/debug/stack_trace.h"
#include "base/file_util.h"
#include "base/files/dir_reader_posix.h"
-#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/posix/eintr_wrapper.h"
@@ -333,13 +332,14 @@
// If a child process uses the readline library, the process block forever.
// In BSD like OSes including OS X it is safe to assign /dev/null as stdin.
// See http://crbug.com/56596.
- base::ScopedFD null_fd(HANDLE_EINTR(open("/dev/null", O_RDONLY)));
- if (!null_fd.is_valid()) {
+ int null_fd = HANDLE_EINTR(open("/dev/null", O_RDONLY));
+ if (null_fd < 0) {
RAW_LOG(ERROR, "Failed to open /dev/null");
_exit(127);
}
- int new_fd = HANDLE_EINTR(dup2(null_fd.get(), STDIN_FILENO));
+ file_util::ScopedFD null_fd_closer(&null_fd);
+ int new_fd = HANDLE_EINTR(dup2(null_fd, STDIN_FILENO));
if (new_fd != STDIN_FILENO) {
RAW_LOG(ERROR, "Failed to dup /dev/null for stdin");
_exit(127);
« no previous file with comments | « base/process/kill_posix.cc ('k') | base/test/launcher/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698