Index: src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc |
diff --git a/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc b/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc |
index e5e61202d5135d2da757be815a083f42f8a26c8a..805263a818206290a52c308c51ef424f842be624 100644 |
--- a/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc |
+++ b/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc |
@@ -30,9 +30,8 @@ using std::vector; |
namespace nacl { |
-SelLdrLauncher::~SelLdrLauncher() { |
+SelLdrLauncherStandalone::~SelLdrLauncherStandalone() { |
CloseHandlesAfterLaunch(); |
-#if defined(NACL_STANDALONE) |
if (kInvalidHandle != child_process_) { |
int status; |
// Ensure child process (service runtime) is kaput. NB: we might |
@@ -46,20 +45,16 @@ SelLdrLauncher::~SelLdrLauncher() { |
KillChildProcess(); |
waitpid(child_process_, &status, 0); |
} |
-#endif |
- if (kInvalidHandle != channel_) { |
- Close(channel_); |
- } |
} |
-nacl::string SelLdrLauncher::GetSelLdrPathName() { |
+nacl::string SelLdrLauncherStandalone::GetSelLdrPathName() { |
char buffer[FILENAME_MAX]; |
GetPluginDirectory(buffer, sizeof(buffer)); |
return nacl::string(buffer) + "/sel_ldr"; |
} |
-nacl::string SelLdrLauncher::GetSelLdrBootstrapPathName() { |
+nacl::string SelLdrLauncherStandalone::GetSelLdrBootstrapPathName() { |
#if NACL_LINUX |
char buffer[FILENAME_MAX]; |
GetPluginDirectory(buffer, sizeof(buffer)); |
@@ -69,7 +64,7 @@ nacl::string SelLdrLauncher::GetSelLdrBootstrapPathName() { |
#endif |
} |
-Handle SelLdrLauncher::CreateBootstrapSocket(nacl::string* dest_fd) { |
+Handle SelLdrLauncherStandalone::CreateBootstrapSocket(nacl::string* dest_fd) { |
Handle pair[2]; |
if (SocketPair(pair) == -1) { |
return kInvalidHandle; |
@@ -85,8 +80,7 @@ Handle SelLdrLauncher::CreateBootstrapSocket(nacl::string* dest_fd) { |
const size_t kMaxExecArgs = 64; |
-#if defined(NACL_STANDALONE) |
-bool SelLdrLauncher::StartViaCommandLine( |
+bool SelLdrLauncherStandalone::StartViaCommandLine( |
const vector<nacl::string>& prefix, |
const vector<nacl::string>& sel_ldr_argv, |
const vector<nacl::string>& app_argv) { |
@@ -129,10 +123,8 @@ bool SelLdrLauncher::StartViaCommandLine( |
CloseHandlesAfterLaunch(); |
return true; |
} |
-#endif |
-bool SelLdrLauncher::KillChildProcess() { |
-#if defined(NACL_STANDALONE) |
+bool SelLdrLauncherStandalone::KillChildProcess() { |
if (kInvalidHandle == child_process_) { |
// It is incorrect to use the kill syscall on kInvalidHandle as |
// the pid, since using -1 as pid is defined by POSIX.1-2001 to |
@@ -144,9 +136,6 @@ bool SelLdrLauncher::KillChildProcess() { |
return 0 == kill(child_process_, SIGKILL); |
// We cannot set child_process_ to kInvalidHandle since we will want to wait |
// on its exit status. |
-#else |
- return false; |
-#endif |
} |
} // namespace nacl |