diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-07-17 09:01:11 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-07-17 14:38:14 +0000 |
commit | 868963dac13ec4265e8642af19ad2b85d2b46ed4 (patch) | |
tree | 8a632182b61e8938c2e4192f2611070384ce01e9 /vespalib | |
parent | 6f26d4daad46da0aa3ccae312da522d203a21585 (diff) |
ChildProc -> ChildProcess
Diffstat (limited to 'vespalib')
15 files changed, 89 insertions, 89 deletions
diff --git a/vespalib/CMakeLists.txt b/vespalib/CMakeLists.txt index 80c789ba379..c894a798b91 100644 --- a/vespalib/CMakeLists.txt +++ b/vespalib/CMakeLists.txt @@ -97,7 +97,7 @@ vespa_define_module( src/tests/sharedptr src/tests/signalhandler src/tests/simple_thread_bundle - src/tests/child_proc + src/tests/child_process src/tests/slime src/tests/slime/external_data_value src/tests/slime/summary-feature-benchmark diff --git a/vespalib/src/tests/assert/assert_test.cpp b/vespalib/src/tests/assert/assert_test.cpp index bdd9f5785dd..8b770f0f3eb 100644 --- a/vespalib/src/tests/assert/assert_test.cpp +++ b/vespalib/src/tests/assert/assert_test.cpp @@ -1,6 +1,6 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/child_proc.h> +#include <vespa/vespalib/util/child_process.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/assert.h> #include <vespa/vespalib/io/fileutil.h> @@ -16,19 +16,19 @@ TEST("that it borks the first time.") { vespalib::rmdir("var", true); ASSERT_TRUE(vespalib::mkdir(assertDir, true)); { - ChildProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ChildProcess proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); proc.wait(); ASSERT_EQUAL(proc.getExitCode() & 0x7f, 6); } { - ChildProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ChildProcess proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); proc.readLine(assertName); proc.wait(); ASSERT_EQUAL(proc.getExitCode() & 0x7f, 0); } ASSERT_EQUAL(0, unlink(assertName.c_str())); { - ChildProc proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ChildProcess proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); proc.wait(); ASSERT_EQUAL(proc.getExitCode() & 0x7f, 6); } diff --git a/vespalib/src/tests/child_proc/.gitignore b/vespalib/src/tests/child_proc/.gitignore deleted file mode 100644 index 8b43b2b332e..00000000000 --- a/vespalib/src/tests/child_proc/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.depend -Makefile -child_proc_test -vespalib_child_proc_test_app diff --git a/vespalib/src/tests/child_proc/CMakeLists.txt b/vespalib/src/tests/child_proc/CMakeLists.txt deleted file mode 100644 index 45f0ae8f9a9..00000000000 --- a/vespalib/src/tests/child_proc/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(vespalib_child_proc_test_app TEST - SOURCES - child_proc_test.cpp - DEPENDS - vespalib -) -vespa_add_test(NAME vespalib_child_proc_test_app COMMAND vespalib_child_proc_test_app) diff --git a/vespalib/src/tests/child_process/.gitignore b/vespalib/src/tests/child_process/.gitignore new file mode 100644 index 00000000000..7e094c772a6 --- /dev/null +++ b/vespalib/src/tests/child_process/.gitignore @@ -0,0 +1,4 @@ +.depend +Makefile +child_process_test +vespalib_child_process_test_app diff --git a/vespalib/src/tests/child_process/CMakeLists.txt b/vespalib/src/tests/child_process/CMakeLists.txt new file mode 100644 index 00000000000..1c9af730510 --- /dev/null +++ b/vespalib/src/tests/child_process/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +vespa_add_executable(vespalib_child_process_test_app TEST + SOURCES + child_process_test.cpp + DEPENDS + vespalib +) +vespa_add_test(NAME vespalib_child_process_test_app COMMAND vespalib_child_process_test_app) diff --git a/vespalib/src/tests/child_proc/child_proc_test.cpp b/vespalib/src/tests/child_process/child_process_test.cpp index d485ef75432..ada29cd370d 100644 --- a/vespalib/src/tests/child_proc/child_proc_test.cpp +++ b/vespalib/src/tests/child_process/child_process_test.cpp @@ -1,57 +1,57 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/child_proc.h> +#include <vespa/vespalib/util/child_process.h> -using vespalib::ChildProc; +using vespalib::ChildProcess; TEST("simple run, ignore output") { - EXPECT_TRUE(ChildProc::run("echo foo")); + EXPECT_TRUE(ChildProcess::run("echo foo")); } TEST("simple run, ignore output, failure") { - EXPECT_TRUE(!ChildProc::run("false")); + EXPECT_TRUE(!ChildProcess::run("false")); } TEST("simple run, ignore output, timeout") { - EXPECT_TRUE(!ChildProc::run("exec sleep 60", 10)); + EXPECT_TRUE(!ChildProcess::run("exec sleep 60", 10)); } TEST("simple run") { std::string out; - EXPECT_TRUE(ChildProc::run("/bin/echo -n foo", out)); + EXPECT_TRUE(ChildProcess::run("/bin/echo -n foo", out)); EXPECT_EQUAL(out, "foo"); } TEST("simple run, strip single-line trailing newline") { std::string out; - EXPECT_TRUE(ChildProc::run("echo foo", out)); + EXPECT_TRUE(ChildProcess::run("echo foo", out)); EXPECT_EQUAL(out, "foo"); } TEST("simple run, don't strip multi-line output") { std::string out; - EXPECT_TRUE(ChildProc::run("perl -e 'print \"foo\\n\\n\"'", out)); + EXPECT_TRUE(ChildProcess::run("perl -e 'print \"foo\\n\\n\"'", out)); EXPECT_EQUAL(out, "foo\n\n"); } TEST("simple run with input") { std::string in = "bar"; std::string out; - EXPECT_TRUE(ChildProc::run(in, "cat", out)); + EXPECT_TRUE(ChildProcess::run(in, "cat", out)); EXPECT_EQUAL(out, "bar"); } TEST("simple run with input, strip single-line trailing newline") { std::string in = "bar\n"; std::string out; - EXPECT_TRUE(ChildProc::run(in, "cat", out)); + EXPECT_TRUE(ChildProcess::run(in, "cat", out)); EXPECT_EQUAL(out, "bar"); } TEST("simple run with input, don't strip multi-line output") { std::string in = "bar\n\n"; std::string out; - EXPECT_TRUE(ChildProc::run(in, "cat", out)); + EXPECT_TRUE(ChildProcess::run(in, "cat", out)); EXPECT_EQUAL("bar\n\n", out); } @@ -64,11 +64,11 @@ TEST_MT("simple run, partial output due to timeout", 2) { (thread_id == 0) ? "out" : "", timeout); if (thread_id == 0) { out.clear(); - EXPECT_TRUE(!ChildProc::run(my_cmd, out, timeout)); + EXPECT_TRUE(!ChildProcess::run(my_cmd, out, timeout)); } else { out.clear(); std::string in = "ignored\n"; - EXPECT_TRUE(!ChildProc::run(in, my_cmd, out, timeout)); + EXPECT_TRUE(!ChildProcess::run(in, my_cmd, out, timeout)); } if (out == "foo") { break; @@ -78,7 +78,7 @@ TEST_MT("simple run, partial output due to timeout", 2) { } TEST("proc failure") { - ChildProc proc("false"); + ChildProcess proc("false"); // read with length 0 will wait for output EXPECT_TRUE(proc.read(NULL, 0) == 0); EXPECT_TRUE(proc.wait(60000)); @@ -90,7 +90,7 @@ TEST("basic read/write") { int x; int read; char buf[64]; - ChildProc proc("cat"); + ChildProcess proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); @@ -117,7 +117,7 @@ TEST("basic read/write") { TEST("continuos run, readLine") { std::string str; - ChildProc proc("cat"); + ChildProcess proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); @@ -142,7 +142,7 @@ TEST("continuos run, readLine") { TEST("readLine, eof flushes last line") { std::string str; - ChildProc proc("cat"); + ChildProcess proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); @@ -166,7 +166,7 @@ TEST("readLine, eof flushes last line") { TEST("long continuos run, readLine") { std::string in; std::string out; - ChildProc proc("cat"); + ChildProcess proc("cat"); EXPECT_TRUE(proc.running()); EXPECT_TRUE(!proc.failed()); diff --git a/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp b/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp index 17cb977631c..787e46cfd91 100644 --- a/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp +++ b/vespalib/src/tests/drop-file-from-cache/drop_file_from_cache_test.cpp @@ -1,23 +1,23 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/child_proc.h> +#include <vespa/vespalib/util/child_process.h> -using vespalib::ChildProc; +using vespalib::ChildProcess; TEST("no arguments") { - ChildProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache"); + ChildProcess drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache"); drop.wait(); EXPECT_EQUAL(1, drop.getExitCode()); } TEST("file does not exist") { - ChildProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache not_exist"); + ChildProcess drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache not_exist"); drop.wait(); EXPECT_EQUAL(2, drop.getExitCode()); } TEST("All is well") { - ChildProc drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache vespalib_drop_file_from_cache_test_app"); + ChildProcess drop("../../apps/vespa-drop-file-from-cache/vespa-drop-file-from-cache vespalib_drop_file_from_cache_test_app"); drop.wait(); EXPECT_EQUAL(0, drop.getExitCode()); } diff --git a/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp b/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp index 7177a195fa3..89030a19cd6 100644 --- a/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp +++ b/vespalib/src/tests/exception_classes/silenceuncaught_test.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/exception.h> -#include <vespa/vespalib/util/child_proc.h> +#include <vespa/vespalib/util/child_process.h> using namespace vespalib; @@ -14,32 +14,32 @@ using namespace vespalib; #endif TEST("that uncaught exception causes negative exitcode.") { - ChildProc proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught"); + ChildProcess proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught"); proc.wait(); EXPECT_LESS(proc.getExitCode(), 0); } TEST("that uncaught silenced exception causes exitcode 66") { - ChildProc proc("exec ./vespalib_caught_uncaught_app silenced_and_uncaught"); + ChildProcess proc("exec ./vespalib_caught_uncaught_app silenced_and_uncaught"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 66); } TEST("that caught silenced exception followed by an uncaught causes negative exitcode.") { - ChildProc proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught_after_silenced_and_caught"); + ChildProcess proc("ulimit -c 0 && exec ./vespalib_caught_uncaught_app uncaught_after_silenced_and_caught"); proc.wait(); EXPECT_LESS(proc.getExitCode(), 0); } TEST("that caught silenced exception causes exitcode 0") { - ChildProc proc("exec ./vespalib_caught_uncaught_app silenced_and_caught"); + ChildProcess proc("exec ./vespalib_caught_uncaught_app silenced_and_caught"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 0); } #ifndef __SANITIZE_ADDRESS__ TEST("that mmap within limits are fine cause exitcode 0") { - ChildProc proc("exec ./vespalib_mmap_app 150000000 10485760 1"); + ChildProcess proc("exec ./vespalib_mmap_app 150000000 10485760 1"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 0); } @@ -48,13 +48,13 @@ TEST("that mmap within limits are fine cause exitcode 0") { // setrlimit with RLIMIT_AS is broken on Darwin #else TEST("that mmap beyond limits cause negative exitcode.") { - ChildProc proc("ulimit -c 0 && exec ./vespalib_mmap_app 100000000 10485760 10"); + ChildProcess proc("ulimit -c 0 && exec ./vespalib_mmap_app 100000000 10485760 10"); proc.wait(); EXPECT_LESS(proc.getExitCode(), 0); } TEST("that mmap beyond limits with set VESPA_SILENCE_CORE_ON_OOM cause exitcode 66.") { - ChildProc proc("VESPA_SILENCE_CORE_ON_OOM=1 exec ./vespalib_mmap_app 100000000 10485760 10"); + ChildProcess proc("VESPA_SILENCE_CORE_ON_OOM=1 exec ./vespalib_mmap_app 100000000 10485760 10"); proc.wait(); EXPECT_EQUAL(proc.getExitCode(), 66); } diff --git a/vespalib/src/tests/host_name/host_name_test.cpp b/vespalib/src/tests/host_name/host_name_test.cpp index 21a8a571119..442da2ac2e8 100644 --- a/vespalib/src/tests/host_name/host_name_test.cpp +++ b/vespalib/src/tests/host_name/host_name_test.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/host_name.h> -#include <vespa/vespalib/util/child_proc.h> +#include <vespa/vespalib/util/child_process.h> using namespace vespalib; diff --git a/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp b/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp index 8ae808839db..db7a51222b7 100644 --- a/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp +++ b/vespalib/src/tests/make_fixture_macros/make_fixture_macros_test.cpp @@ -1,12 +1,12 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/child_proc.h> +#include <vespa/vespalib/util/child_process.h> using namespace vespalib; bool runPrint(const char *cmd) { std::string out; - bool res = ChildProc::run(cmd, out); + bool res = ChildProcess::run(cmd, out); fprintf(stderr, "%s", out.c_str()); return res; } diff --git a/vespalib/src/tests/tutorial/make_tutorial.cpp b/vespalib/src/tests/tutorial/make_tutorial.cpp index 25398490318..de0eb585e3c 100644 --- a/vespalib/src/tests/tutorial/make_tutorial.cpp +++ b/vespalib/src/tests/tutorial/make_tutorial.cpp @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/child_proc.h> +#include <vespa/vespalib/util/child_process.h> #include <vespa/vespalib/util/stringfmt.h> #include <sys/mman.h> #include <sys/stat.h> @@ -20,7 +20,7 @@ std::string readFile(const std::string &filename) { std::string runCommand(const std::string &cmd) { std::string out; - ASSERT_TRUE(ChildProc::run(cmd.c_str(), out)); + ASSERT_TRUE(ChildProcess::run(cmd.c_str(), out)); return out; } diff --git a/vespalib/src/vespa/vespalib/util/CMakeLists.txt b/vespalib/src/vespa/vespalib/util/CMakeLists.txt index 65b6f508d72..0973653861f 100644 --- a/vespalib/src/vespa/vespalib/util/CMakeLists.txt +++ b/vespalib/src/vespa/vespalib/util/CMakeLists.txt @@ -46,7 +46,7 @@ vespa_add_library(vespalib_vespalib_util OBJECT sig_catch.cpp signalhandler.cpp simple_thread_bundle.cpp - child_proc.cpp + child_process.cpp stash.cpp string_hash.cpp stringfmt.cpp diff --git a/vespalib/src/vespa/vespalib/util/child_proc.cpp b/vespalib/src/vespa/vespalib/util/child_process.cpp index 37a0a905d27..ce0c2eb1779 100644 --- a/vespalib/src/vespa/vespalib/util/child_proc.cpp +++ b/vespalib/src/vespa/vespalib/util/child_process.cpp @@ -1,17 +1,17 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "guard.h" -#include "child_proc.h" +#include "child_process.h" #include <cstring> namespace vespalib { -namespace child_proc { +namespace child_process { using namespace std::chrono; /** - * @brief ChildProc internal timeout management. + * @brief ChildProcess internal timeout management. **/ class Timer { @@ -54,14 +54,14 @@ public: } }; -} // namespace child_proc +} // namespace child_process -using child_proc::Timer; +using child_process::Timer; //----------------------------------------------------------------------------- void -ChildProc::Reader::OnReceiveData(const void *data, size_t length) +ChildProcess::Reader::OnReceiveData(const void *data, size_t length) { const char *buf = (const char *) data; MonitorGuard lock(_cond); @@ -80,7 +80,7 @@ ChildProc::Reader::OnReceiveData(const void *data, size_t length) bool -ChildProc::Reader::hasData() +ChildProcess::Reader::hasData() { // NB: caller has lock on _cond return (!_data.empty() || !_queue.empty()); @@ -88,7 +88,7 @@ ChildProc::Reader::hasData() bool -ChildProc::Reader::waitForData(Timer &timer, MonitorGuard &lock) +ChildProcess::Reader::waitForData(Timer &timer, MonitorGuard &lock) { // NB: caller has lock on _cond CounterGuard count(_waitCnt); @@ -100,7 +100,7 @@ ChildProc::Reader::waitForData(Timer &timer, MonitorGuard &lock) void -ChildProc::Reader::updateEOF() +ChildProcess::Reader::updateEOF() { // NB: caller has lock on _cond if (_data.empty() && _queue.empty() && _gotEOF) { @@ -109,7 +109,7 @@ ChildProc::Reader::updateEOF() } -ChildProc::Reader::Reader() +ChildProcess::Reader::Reader() : _cond(), _queue(), _data(), @@ -120,13 +120,13 @@ ChildProc::Reader::Reader() } -ChildProc::Reader::~Reader() +ChildProcess::Reader::~Reader() { } uint32_t -ChildProc::Reader::read(char *buf, uint32_t len, int msTimeout) +ChildProcess::Reader::read(char *buf, uint32_t len, int msTimeout) { if (eof()) { return 0; @@ -156,7 +156,7 @@ ChildProc::Reader::read(char *buf, uint32_t len, int msTimeout) bool -ChildProc::Reader::readLine(std::string &line, int msTimeout) +ChildProcess::Reader::readLine(std::string &line, int msTimeout) { line.clear(); if (eof()) { @@ -193,7 +193,7 @@ ChildProc::Reader::readLine(std::string &line, int msTimeout) //----------------------------------------------------------------------------- void -ChildProc::checkProc() +ChildProcess::checkProc() { if (_running) { bool stillRunning; @@ -205,7 +205,7 @@ ChildProc::checkProc() } -ChildProc::ChildProc(const char *cmd) +ChildProcess::ChildProcess(const char *cmd) : _reader(), _proc(cmd, true, &_reader), _running(false), @@ -217,11 +217,11 @@ ChildProc::ChildProc(const char *cmd) } -ChildProc::~ChildProc() = default; +ChildProcess::~ChildProcess() = default; bool -ChildProc::write(const char *buf, uint32_t len) +ChildProcess::write(const char *buf, uint32_t len) { if (len == 0) { return true; @@ -231,28 +231,28 @@ ChildProc::write(const char *buf, uint32_t len) bool -ChildProc::close() +ChildProcess::close() { return _proc.WriteStdin(nullptr, 0); } uint32_t -ChildProc::read(char *buf, uint32_t len, int msTimeout) +ChildProcess::read(char *buf, uint32_t len, int msTimeout) { return _reader.read(buf, len, msTimeout); } bool -ChildProc::readLine(std::string &line, int msTimeout) +ChildProcess::readLine(std::string &line, int msTimeout) { return _reader.readLine(line, msTimeout); } bool -ChildProc::wait(int msTimeout) +ChildProcess::wait(int msTimeout) { bool done = true; checkProc(); @@ -273,7 +273,7 @@ ChildProc::wait(int msTimeout) bool -ChildProc::running() +ChildProcess::running() { checkProc(); return _running; @@ -281,24 +281,24 @@ ChildProc::running() bool -ChildProc::failed() +ChildProcess::failed() { checkProc(); return _failed; } int -ChildProc::getExitCode() +ChildProcess::getExitCode() { return _exitCode; } bool -ChildProc::run(const std::string &input, const char *cmd, +ChildProcess::run(const std::string &input, const char *cmd, std::string &output, int msTimeout) { - ChildProc proc(cmd); + ChildProcess proc(cmd); Timer timer(msTimeout); char buf[4096]; proc.write(input.data(), input.length()); @@ -317,7 +317,7 @@ ChildProc::run(const std::string &input, const char *cmd, bool -ChildProc::run(const char *cmd, std::string &output, int msTimeout) +ChildProcess::run(const char *cmd, std::string &output, int msTimeout) { std::string input; // empty input return run(input, cmd, output, msTimeout); @@ -325,7 +325,7 @@ ChildProc::run(const char *cmd, std::string &output, int msTimeout) bool -ChildProc::run(const char *cmd, int msTimeout) +ChildProcess::run(const char *cmd, int msTimeout) { std::string input; // empty input std::string output; // ignore output diff --git a/vespalib/src/vespa/vespalib/util/child_proc.h b/vespalib/src/vespa/vespalib/util/child_process.h index 16846dcb80a..0ae7206ac48 100644 --- a/vespalib/src/vespa/vespalib/util/child_proc.h +++ b/vespalib/src/vespa/vespalib/util/child_process.h @@ -8,7 +8,7 @@ #include <queue> #include "sync.h" -namespace vespalib::child_proc { class Timer; } +namespace vespalib::child_process { class Timer; } namespace vespalib { /** @@ -18,7 +18,7 @@ namespace vespalib { * where you need to run, control and communicate with * some external program. **/ -class ChildProc +class ChildProcess { private: class Reader : public FastOS_ProcessRedirectListener @@ -33,7 +33,7 @@ private: void OnReceiveData(const void *data, size_t length) override; bool hasData(); - bool waitForData(child_proc::Timer &timer, MonitorGuard &lock); + bool waitForData(child_process::Timer &timer, MonitorGuard &lock); void updateEOF(); public: @@ -54,8 +54,8 @@ private: void checkProc(); public: - ChildProc(const ChildProc &) = delete; - ChildProc &operator=(const ChildProc &) = delete; + ChildProcess(const ChildProcess &) = delete; + ChildProcess &operator=(const ChildProcess &) = delete; /** * @brief Run a child process @@ -63,10 +63,10 @@ public: * Starts a process running the given command * @param cmd A shell command line to run **/ - explicit ChildProc(const char *cmd); + explicit ChildProcess(const char *cmd); /** @brief destructor doing cleanup if needed */ - ~ChildProc(); + ~ChildProcess(); /** * @return process id |