From 8f9e6a1bd180d945c4d9c834b87ee8d8ec11cb2c Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Wed, 1 Sep 2021 19:46:11 +0000 Subject: gc unused code * ProcessStarter Start() is now never called, remove it. * ProcessStarter Stop() is now a no-op, remove it and its usage. --- fastos/src/vespa/fastos/unix_app.cpp | 1 - fastos/src/vespa/fastos/unix_process.cpp | 36 -------------------------------- fastos/src/vespa/fastos/unix_process.h | 2 -- 3 files changed, 39 deletions(-) (limited to 'fastos') 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); -- cgit v1.2.3