diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-09-01 19:46:11 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-09-01 19:46:11 +0000 |
commit | 8f9e6a1bd180d945c4d9c834b87ee8d8ec11cb2c (patch) | |
tree | ce5e14ecffb682e1cdf4f94993566e7123516e12 /fastos | |
parent | c0df602eae1b633a5172ffbf92e19116ed08f9d9 (diff) |
gc unused code
* ProcessStarter Start() is now never called, remove it.
* ProcessStarter Stop() is now a no-op, remove it and its usage.
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/vespa/fastos/unix_app.cpp | 1 | ||||
-rw-r--r-- | fastos/src/vespa/fastos/unix_process.cpp | 36 | ||||
-rw-r--r-- | fastos/src/vespa/fastos/unix_process.h | 2 |
3 files changed, 0 insertions, 39 deletions
diff --git a/fastos/src/vespa/fastos/unix_app.cpp b/fastos/src/vespa/fastos/unix_app.cpp index a6add890d95..565cf6e57ff 100644 --- a/fastos/src/vespa/fastos/unix_app.cpp +++ b/fastos/src/vespa/fastos/unix_app.cpp @@ -139,7 +139,6 @@ void FastOS_UNIX_Application::Cleanup () if (_processListMutex) { guard = getProcessGuard(); } - _processStarter->Stop(); } delete _processStarter; _processStarter = nullptr; diff --git a/fastos/src/vespa/fastos/unix_process.cpp b/fastos/src/vespa/fastos/unix_process.cpp index c1692b4e76a..519a6df4f05 100644 --- a/fastos/src/vespa/fastos/unix_process.cpp +++ b/fastos/src/vespa/fastos/unix_process.cpp @@ -1339,42 +1339,6 @@ FastOS_UNIX_ProcessStarter::~FastOS_UNIX_ProcessStarter () close(_mainSocket); } -bool FastOS_UNIX_ProcessStarter::Start () -{ - bool rc = false; - - if (CreateSocketPairs()) { - pid_t pid = safe_fork(); - if (pid != -1) { - if (pid == 0) { // Child - close(_mainSocket); // Close unused end of pipes - close(_mainSocketDescr); - _mainSocket = -1; - _mainSocketDescr = -1; - Run(); // Never returns - } else { // Parent - _pid = pid; - close(_starterSocket); // Close unused end of pipes - close(_starterSocketDescr); - _starterSocket = -1; - _starterSocketDescr = -1; - rc = true; - } - } else { - std::error_code ec(errno, std::system_category()); - fprintf(stderr, "could not fork(): %s\n", ec.message().c_str()); - } - } else { - std::error_code ec(errno, std::system_category()); - fprintf(stderr, "could not CreateSocketPairs: %s\n", ec.message().c_str()); - } - return rc; -} - -void FastOS_UNIX_ProcessStarter::Stop () -{ -} - char ** FastOS_UNIX_ProcessStarter::ReceiveEnvironmentVariables () { int numEnvVars = ReadInt(_starterSocket); diff --git a/fastos/src/vespa/fastos/unix_process.h b/fastos/src/vespa/fastos/unix_process.h index 27e8c175d44..346d7def100 100644 --- a/fastos/src/vespa/fastos/unix_process.h +++ b/fastos/src/vespa/fastos/unix_process.h @@ -212,8 +212,6 @@ public: FastOS_UNIX_ProcessStarter (FastOS_ApplicationInterface *app); ~FastOS_UNIX_ProcessStarter (); - bool Start (); - void Stop (); void CloseProxiedChildDescs(); void CloseProxyDescs(int stdinPipedDes, int stdoutPipedDes, int stderrPipedDes, int ipcDes, int handshakeDes0, int handshakeDes1); |