Module Name: src Committed By: lukem Date: Thu Jul 2 14:04:01 UTC 2020
Modified Files: src/external/bsd/kyua-cli: Makefile.inc src/external/bsd/kyua-cli/dist/cli: cmd_report.hpp common.hpp main.cpp src/external/bsd/kyua-cli/dist/engine: config.cpp metadata.cpp metadata.hpp testers.cpp src/external/bsd/kyua-cli/dist/utils/cmdline: commands_map.hpp src/external/bsd/kyua-cli/dist/utils/config: lua_module_test.cpp nodes.cpp parser.hpp tree_test.cpp src/external/bsd/kyua-cli/dist/utils/format: formatter.cpp src/external/bsd/kyua-cli/dist/utils/logging: operations.cpp src/external/bsd/kyua-cli/dist/utils/process: child.cpp child.hpp child.ipp child_test.cpp fdstream.hpp systembuf.hpp src/external/bsd/kyua-cli/dist/utils/signals: interrupts.cpp interrupts_test.cpp misc_test.cpp programmer.hpp Log Message: kyua-cli: convert auto_ptr to unique_ptr Update kyua-cli to C++11 and use unique_ptr instead of auto_ptr, (with std::move() where appropriate), to avoid deprecated warning by g++ 8. (I didn't change some of the code that could arguably be refactored to use unique_ptr or shared_ptr instead of raw pointers and therefore remove the special case destructor handling). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/kyua-cli/Makefile.inc cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/kyua-cli/dist/cli/cmd_report.hpp \ src/external/bsd/kyua-cli/dist/cli/main.cpp cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/kyua-cli/dist/cli/common.hpp cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/kyua-cli/dist/engine/config.cpp \ src/external/bsd/kyua-cli/dist/engine/metadata.cpp cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/bsd/kyua-cli/dist/engine/metadata.hpp \ src/external/bsd/kyua-cli/dist/engine/testers.cpp cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/cmdline/commands_map.hpp cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/config/lua_module_test.cpp \ src/external/bsd/kyua-cli/dist/utils/config/nodes.cpp \ src/external/bsd/kyua-cli/dist/utils/config/parser.hpp \ src/external/bsd/kyua-cli/dist/utils/config/tree_test.cpp cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/format/formatter.cpp cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/logging/operations.cpp cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/process/child.cpp cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/process/child.hpp \ src/external/bsd/kyua-cli/dist/utils/process/child.ipp \ src/external/bsd/kyua-cli/dist/utils/process/child_test.cpp \ src/external/bsd/kyua-cli/dist/utils/process/fdstream.hpp \ src/external/bsd/kyua-cli/dist/utils/process/systembuf.hpp cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/signals/interrupts.cpp \ src/external/bsd/kyua-cli/dist/utils/signals/interrupts_test.cpp \ src/external/bsd/kyua-cli/dist/utils/signals/programmer.hpp cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/bsd/kyua-cli/dist/utils/signals/misc_test.cpp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/kyua-cli/Makefile.inc diff -u src/external/bsd/kyua-cli/Makefile.inc:1.5 src/external/bsd/kyua-cli/Makefile.inc:1.6 --- src/external/bsd/kyua-cli/Makefile.inc:1.5 Sun Jun 21 14:26:16 2020 +++ src/external/bsd/kyua-cli/Makefile.inc Thu Jul 2 14:04:00 2020 @@ -1,13 +1,10 @@ -# $NetBSD: Makefile.inc,v 1.5 2020/06/21 14:26:16 lukem Exp $ +# $NetBSD: Makefile.inc,v 1.6 2020/07/02 14:04:00 lukem Exp $ .include <bsd.own.mk> TOPDIR= ${NETBSDSRCDIR}/external/bsd/kyua-cli SRCDIR= ${TOPDIR}/dist -# Kyua uses auto_ptr; g++ 8 complains about it -CXXFLAGS+= -Wno-deprecated-declarations - # Name of the private libraries (without their lib prefix) to depend on. KYUA_LIBS?= Index: src/external/bsd/kyua-cli/dist/cli/cmd_report.hpp diff -u src/external/bsd/kyua-cli/dist/cli/cmd_report.hpp:1.1.1.1 src/external/bsd/kyua-cli/dist/cli/cmd_report.hpp:1.2 --- src/external/bsd/kyua-cli/dist/cli/cmd_report.hpp:1.1.1.1 Sat Feb 23 12:34:04 2013 +++ src/external/bsd/kyua-cli/dist/cli/cmd_report.hpp Thu Jul 2 14:04:00 2020 @@ -63,7 +63,7 @@ class file_writer : utils::noncopyable { const utils::fs::path _output_path; /// The output file, if not stdout nor stderr. - std::auto_ptr< std::ofstream > _output_file; + std::unique_ptr< std::ofstream > _output_file; /// Constant that represents the path to stdout. static const utils::fs::path _stdout_path; Index: src/external/bsd/kyua-cli/dist/cli/main.cpp diff -u src/external/bsd/kyua-cli/dist/cli/main.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/cli/main.cpp:1.2 --- src/external/bsd/kyua-cli/dist/cli/main.cpp:1.1.1.1 Sat Feb 23 12:34:04 2013 +++ src/external/bsd/kyua-cli/dist/cli/main.cpp Thu Jul 2 14:04:00 2020 @@ -171,7 +171,7 @@ safe_main(cmdline::ui* ui, int argc, con commands.insert(new cli::cmd_report_html(), "Reporting"); if (mock_command.get() != NULL) - commands.insert(mock_command); + commands.insert(std::move(mock_command)); const cmdline::parsed_cmdline cmdline = cmdline::parse(argc, argv, options); @@ -249,7 +249,7 @@ cli::main(cmdline::ui* ui, const int arg cli_command_ptr mock_command) { try { - const int exit_code = safe_main(ui, argc, argv, mock_command); + const int exit_code = safe_main(ui, argc, argv, std::move(mock_command)); // Codes above 1 are reserved to report conditions captured as // exceptions below. Index: src/external/bsd/kyua-cli/dist/cli/common.hpp diff -u src/external/bsd/kyua-cli/dist/cli/common.hpp:1.1.1.2 src/external/bsd/kyua-cli/dist/cli/common.hpp:1.2 --- src/external/bsd/kyua-cli/dist/cli/common.hpp:1.1.1.2 Fri Oct 18 23:40:08 2013 +++ src/external/bsd/kyua-cli/dist/cli/common.hpp Thu Jul 2 14:04:00 2020 @@ -76,7 +76,7 @@ typedef utils::cmdline::base_command< ut /// Scoped, strictly owned pointer to a cli_command. -typedef std::auto_ptr< cli_command > cli_command_ptr; +typedef std::unique_ptr< cli_command > cli_command_ptr; /// Collection of result types. Index: src/external/bsd/kyua-cli/dist/engine/config.cpp diff -u src/external/bsd/kyua-cli/dist/engine/config.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/engine/config.cpp:1.2 --- src/external/bsd/kyua-cli/dist/engine/config.cpp:1.1.1.1 Sat Feb 23 12:34:04 2013 +++ src/external/bsd/kyua-cli/dist/engine/config.cpp Thu Jul 2 14:04:00 2020 @@ -125,7 +125,7 @@ public: config::detail::base_node* engine::user_node::deep_copy(void) const { - std::auto_ptr< user_node > new_node(new user_node()); + std::unique_ptr< user_node > new_node(new user_node()); new_node->_value = _value; return new_node.release(); } Index: src/external/bsd/kyua-cli/dist/engine/metadata.cpp diff -u src/external/bsd/kyua-cli/dist/engine/metadata.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/engine/metadata.cpp:1.2 --- src/external/bsd/kyua-cli/dist/engine/metadata.cpp:1.1.1.1 Sat Feb 23 12:34:04 2013 +++ src/external/bsd/kyua-cli/dist/engine/metadata.cpp Thu Jul 2 14:04:00 2020 @@ -72,7 +72,7 @@ public: virtual base_node* deep_copy(void) const { - std::auto_ptr< bytes_node > new_node(new bytes_node()); + std::unique_ptr< bytes_node > new_node(new bytes_node()); new_node->_value = _value; return new_node.release(); } @@ -108,7 +108,7 @@ public: virtual base_node* deep_copy(void) const { - std::auto_ptr< delta_node > new_node(new delta_node()); + std::unique_ptr< delta_node > new_node(new delta_node()); new_node->_value = _value; return new_node.release(); } @@ -174,7 +174,7 @@ class user_node : public config::string_ virtual base_node* deep_copy(void) const { - std::auto_ptr< user_node > new_node(new user_node()); + std::unique_ptr< user_node > new_node(new user_node()); new_node->_value = _value; return new_node.release(); } @@ -205,7 +205,7 @@ class paths_set_node : public config::ba virtual base_node* deep_copy(void) const { - std::auto_ptr< paths_set_node > new_node(new paths_set_node()); + std::unique_ptr< paths_set_node > new_node(new paths_set_node()); new_node->_value = _value; return new_node.release(); } Index: src/external/bsd/kyua-cli/dist/engine/metadata.hpp diff -u src/external/bsd/kyua-cli/dist/engine/metadata.hpp:1.1.1.2 src/external/bsd/kyua-cli/dist/engine/metadata.hpp:1.2 --- src/external/bsd/kyua-cli/dist/engine/metadata.hpp:1.1.1.2 Fri Oct 18 23:40:14 2013 +++ src/external/bsd/kyua-cli/dist/engine/metadata.hpp Thu Jul 2 14:04:00 2020 @@ -107,7 +107,7 @@ class metadata_builder : utils::noncopya struct impl; /// Pointer to the shared internal implementation. - std::auto_ptr< impl > _pimpl; + std::unique_ptr< impl > _pimpl; public: metadata_builder(void); Index: src/external/bsd/kyua-cli/dist/engine/testers.cpp diff -u src/external/bsd/kyua-cli/dist/engine/testers.cpp:1.1.1.2 src/external/bsd/kyua-cli/dist/engine/testers.cpp:1.2 --- src/external/bsd/kyua-cli/dist/engine/testers.cpp:1.1.1.2 Fri Oct 18 23:40:15 2013 +++ src/external/bsd/kyua-cli/dist/engine/testers.cpp Thu Jul 2 14:04:00 2020 @@ -247,7 +247,7 @@ engine::tester::list(const fs::path& pro args.push_back(program.str()); const fs::path tester_path = engine::tester_path(_interface); - std::auto_ptr< process::child > child = process::child::spawn_capture( + std::unique_ptr< process::child > child = process::child::spawn_capture( tester_path, args); const std::string output = utils::read_stream(child->output()); @@ -288,7 +288,7 @@ engine::tester::test(const fs::path& pro args.push_back(result_file.str()); const fs::path tester_path = engine::tester_path(_interface); - std::auto_ptr< process::child > child = process::child::spawn_files( + std::unique_ptr< process::child > child = process::child::spawn_files( tester_path, args, stdout_file, stderr_file); const process::status status = child->wait(); Index: src/external/bsd/kyua-cli/dist/utils/cmdline/commands_map.hpp diff -u src/external/bsd/kyua-cli/dist/utils/cmdline/commands_map.hpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/cmdline/commands_map.hpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/cmdline/commands_map.hpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/cmdline/commands_map.hpp Thu Jul 2 14:04:00 2020 @@ -70,7 +70,7 @@ public: ~commands_map(void); /// Scoped, strictly-owned pointer to a command from this map. - typedef typename std::auto_ptr< BaseCommand > command_ptr; + typedef typename std::unique_ptr< BaseCommand > command_ptr; void insert(command_ptr, const std::string& = ""); void insert(BaseCommand*, const std::string& = ""); Index: src/external/bsd/kyua-cli/dist/utils/config/lua_module_test.cpp diff -u src/external/bsd/kyua-cli/dist/utils/config/lua_module_test.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/config/lua_module_test.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/config/lua_module_test.cpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/config/lua_module_test.cpp Thu Jul 2 14:04:00 2020 @@ -67,7 +67,7 @@ public: virtual base_node* deep_copy(void) const { - std::auto_ptr< custom_node > new_node(new custom_node()); + std::unique_ptr< custom_node > new_node(new custom_node()); new_node->_value = _value; return new_node.release(); } Index: src/external/bsd/kyua-cli/dist/utils/config/nodes.cpp diff -u src/external/bsd/kyua-cli/dist/utils/config/nodes.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/config/nodes.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/config/nodes.cpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/config/nodes.cpp Thu Jul 2 14:04:00 2020 @@ -223,7 +223,7 @@ config::detail::static_inner_node::stati config::detail::base_node* config::detail::static_inner_node::deep_copy(void) const { - std::auto_ptr< inner_node > new_node(new static_inner_node()); + std::unique_ptr< inner_node > new_node(new static_inner_node()); copy_into(new_node.get()); return new_node.release(); } @@ -286,7 +286,7 @@ config::detail::dynamic_inner_node::dyna config::detail::base_node* config::detail::dynamic_inner_node::deep_copy(void) const { - std::auto_ptr< inner_node > new_node(new dynamic_inner_node()); + std::unique_ptr< inner_node > new_node(new dynamic_inner_node()); copy_into(new_node.get()); return new_node.release(); } @@ -304,7 +304,7 @@ config::leaf_node::~leaf_node(void) config::detail::base_node* config::bool_node::deep_copy(void) const { - std::auto_ptr< bool_node > new_node(new bool_node()); + std::unique_ptr< bool_node > new_node(new bool_node()); new_node->_value = _value; return new_node.release(); } @@ -343,7 +343,7 @@ config::bool_node::set_lua(lutok::state& config::detail::base_node* config::int_node::deep_copy(void) const { - std::auto_ptr< int_node > new_node(new int_node()); + std::unique_ptr< int_node > new_node(new int_node()); new_node->_value = _value; return new_node.release(); } @@ -382,7 +382,7 @@ config::int_node::set_lua(lutok::state& config::detail::base_node* config::string_node::deep_copy(void) const { - std::auto_ptr< string_node > new_node(new string_node()); + std::unique_ptr< string_node > new_node(new string_node()); new_node->_value = _value; return new_node.release(); } @@ -421,7 +421,7 @@ config::string_node::set_lua(lutok::stat config::detail::base_node* config::strings_set_node::deep_copy(void) const { - std::auto_ptr< strings_set_node > new_node(new strings_set_node()); + std::unique_ptr< strings_set_node > new_node(new strings_set_node()); new_node->_value = _value; return new_node.release(); } Index: src/external/bsd/kyua-cli/dist/utils/config/parser.hpp diff -u src/external/bsd/kyua-cli/dist/utils/config/parser.hpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/config/parser.hpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/config/parser.hpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/config/parser.hpp Thu Jul 2 14:04:00 2020 @@ -66,7 +66,7 @@ public: private: /// Pointer to the internal implementation. - std::auto_ptr< impl > _pimpl; + std::unique_ptr< impl > _pimpl; /// Hook to initialize the tree keys before reading the file. /// Index: src/external/bsd/kyua-cli/dist/utils/config/tree_test.cpp diff -u src/external/bsd/kyua-cli/dist/utils/config/tree_test.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/config/tree_test.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/config/tree_test.cpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/config/tree_test.cpp Thu Jul 2 14:04:00 2020 @@ -76,7 +76,7 @@ public: virtual base_node* deep_copy(void) const { - std::auto_ptr< wrapped_int_node > new_node(new wrapped_int_node()); + std::unique_ptr< wrapped_int_node > new_node(new wrapped_int_node()); new_node->_value = _value; return new_node.release(); } Index: src/external/bsd/kyua-cli/dist/utils/format/formatter.cpp diff -u src/external/bsd/kyua-cli/dist/utils/format/formatter.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/format/formatter.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/format/formatter.cpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/format/formatter.cpp Thu Jul 2 14:04:00 2020 @@ -118,7 +118,7 @@ to_int(const std::string& format, const static std::ostringstream* new_ostringstream(const std::string& format) { - std::auto_ptr< std::ostringstream > output(new std::ostringstream()); + std::unique_ptr< std::ostringstream > output(new std::ostringstream()); if (format.length() <= 2) { // If the format is empty, we create a new stream so that we don't have Index: src/external/bsd/kyua-cli/dist/utils/logging/operations.cpp diff -u src/external/bsd/kyua-cli/dist/utils/logging/operations.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/logging/operations.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/logging/operations.cpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/logging/operations.cpp Thu Jul 2 14:04:00 2020 @@ -96,7 +96,7 @@ static std::vector< std::pair< logging:: /// Stream to the currently open log file. -static std::auto_ptr< std::ofstream > logfile; +static std::unique_ptr< std::ofstream > logfile; /// Constant string to strftime to format timestamps. Index: src/external/bsd/kyua-cli/dist/utils/process/child.cpp diff -u src/external/bsd/kyua-cli/dist/utils/process/child.cpp:1.1.1.2 src/external/bsd/kyua-cli/dist/utils/process/child.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/process/child.cpp:1.1.1.2 Fri Oct 18 23:40:42 2013 +++ src/external/bsd/kyua-cli/dist/utils/process/child.cpp Thu Jul 2 14:04:00 2020 @@ -65,7 +65,7 @@ struct child::impl { pid_t _pid; /// The input stream for the process' stdout and stderr. May be NULL. - std::auto_ptr< process::ifdstream > _output; + std::unique_ptr< process::ifdstream > _output; /// Initializes private implementation data. /// @@ -252,7 +252,7 @@ process::child::~child(void) /// noncopyable. In the case of the child, a NULL pointer. /// /// \throw process::system_error If the calls to pipe(2) or fork(2) fail. -std::auto_ptr< process::child > +std::unique_ptr< process::child > process::child::fork_capture_aux(void) { std::cout.flush(); @@ -262,7 +262,7 @@ process::child::fork_capture_aux(void) if (detail::syscall_pipe(fds) == -1) throw process::system_error("pipe(2) failed", errno); - std::auto_ptr< signals::interrupts_inhibiter > inhibiter( + std::unique_ptr< signals::interrupts_inhibiter > inhibiter( new signals::interrupts_inhibiter); pid_t pid = detail::syscall_fork(); if (pid == -1) { @@ -283,13 +283,13 @@ process::child::fork_capture_aux(void) std::cerr << F("Failed to set up subprocess: %s\n") % e.what(); std::abort(); } - return std::auto_ptr< process::child >(NULL); + return std::unique_ptr< process::child >(); } else { ::close(fds[1]); LD(F("Spawned process %s: stdout and stderr inherited") % pid); signals::add_pid_to_kill(pid); inhibiter.reset(NULL); // Unblock signals. - return std::auto_ptr< process::child >( + return std::unique_ptr< process::child >( new process::child(new impl(pid, new process::ifdstream(fds[0])))); } } @@ -312,14 +312,14 @@ process::child::fork_capture_aux(void) /// noncopyable. In the case of the child, a NULL pointer. /// /// \throw process::system_error If the call to fork(2) fails. -std::auto_ptr< process::child > +std::unique_ptr< process::child > process::child::fork_files_aux(const fs::path& stdout_file, const fs::path& stderr_file) { std::cout.flush(); std::cerr.flush(); - std::auto_ptr< signals::interrupts_inhibiter > inhibiter( + std::unique_ptr< signals::interrupts_inhibiter > inhibiter( new signals::interrupts_inhibiter); pid_t pid = detail::syscall_fork(); if (pid == -1) { @@ -344,13 +344,13 @@ process::child::fork_files_aux(const fs: std::cerr << F("Failed to set up subprocess: %s\n") % e.what(); std::abort(); } - return std::auto_ptr< process::child >(NULL); + return std::unique_ptr< process::child >(); } else { LD(F("Spawned process %s: stdout=%s, stderr=%s") % pid % stdout_file % stderr_file); signals::add_pid_to_kill(pid); inhibiter.reset(NULL); // Unblock signals. - return std::auto_ptr< process::child >( + return std::unique_ptr< process::child >( new process::child(new impl(pid, NULL))); } } @@ -369,10 +369,10 @@ process::child::fork_files_aux(const fs: /// /// \throw process::system_error If the process cannot be spawned due to a /// system call error. -std::auto_ptr< process::child > +std::unique_ptr< process::child > process::child::spawn_capture(const fs::path& program, const args_vector& args) { - std::auto_ptr< child > child = fork_capture_aux(); + std::unique_ptr< child > child = fork_capture_aux(); if (child.get() == NULL) cxx_exec(program, args); log_exec(program, args); @@ -395,13 +395,13 @@ process::child::spawn_capture(const fs:: /// /// \throw process::system_error If the process cannot be spawned due to a /// system call error. -std::auto_ptr< process::child > +std::unique_ptr< process::child > process::child::spawn_files(const fs::path& program, const args_vector& args, const fs::path& stdout_file, const fs::path& stderr_file) { - std::auto_ptr< child > child = fork_files_aux(stdout_file, stderr_file); + std::unique_ptr< child > child = fork_files_aux(stdout_file, stderr_file); if (child.get() == NULL) cxx_exec(program, args); log_exec(program, args); Index: src/external/bsd/kyua-cli/dist/utils/process/child.hpp diff -u src/external/bsd/kyua-cli/dist/utils/process/child.hpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/process/child.hpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/process/child.hpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/process/child.hpp Thu Jul 2 14:04:00 2020 @@ -68,11 +68,11 @@ class child : noncopyable { struct impl; /// Pointer to the shared internal implementation. - std::auto_ptr< impl > _pimpl; + std::unique_ptr< impl > _pimpl; - static std::auto_ptr< child > fork_capture_aux(void); + static std::unique_ptr< child > fork_capture_aux(void); - static std::auto_ptr< child > fork_files_aux(const fs::path&, + static std::unique_ptr< child > fork_files_aux(const fs::path&, const fs::path&); explicit child(impl *); @@ -81,16 +81,16 @@ public: ~child(void); template< typename Hook > - static std::auto_ptr< child > fork_capture(Hook); + static std::unique_ptr< child > fork_capture(Hook); std::istream& output(void); template< typename Hook > - static std::auto_ptr< child > fork_files(Hook, const fs::path&, + static std::unique_ptr< child > fork_files(Hook, const fs::path&, const fs::path&); - static std::auto_ptr< child > spawn_capture( + static std::unique_ptr< child > spawn_capture( const fs::path&, const args_vector&); - static std::auto_ptr< child > spawn_files( + static std::unique_ptr< child > spawn_files( const fs::path&, const args_vector&, const fs::path&, const fs::path&); int pid(void) const; Index: src/external/bsd/kyua-cli/dist/utils/process/child.ipp diff -u src/external/bsd/kyua-cli/dist/utils/process/child.ipp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/process/child.ipp:1.2 --- src/external/bsd/kyua-cli/dist/utils/process/child.ipp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/process/child.ipp Thu Jul 2 14:04:00 2020 @@ -52,11 +52,11 @@ namespace process { /// \throw process::system_error If the process cannot be spawned due to a /// system call error. template< typename Hook > -std::auto_ptr< child > +std::unique_ptr< child > child::fork_files(Hook hook, const fs::path& stdout_file, const fs::path& stderr_file) { - std::auto_ptr< child > child = fork_files_aux(stdout_file, stderr_file); + std::unique_ptr< child > child = fork_files_aux(stdout_file, stderr_file); if (child.get() == NULL) { try { hook(); @@ -83,10 +83,10 @@ child::fork_files(Hook hook, const fs::p /// \throw process::system_error If the process cannot be spawned due to a /// system call error. template< typename Hook > -std::auto_ptr< child > +std::unique_ptr< child > child::fork_capture(Hook hook) { - std::auto_ptr< child > child = fork_capture_aux(); + std::unique_ptr< child > child = fork_capture_aux(); if (child.get() == NULL) { try { hook(); Index: src/external/bsd/kyua-cli/dist/utils/process/child_test.cpp diff -u src/external/bsd/kyua-cli/dist/utils/process/child_test.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/process/child_test.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/process/child_test.cpp:1.1.1.1 Sat Feb 23 12:34:07 2013 +++ src/external/bsd/kyua-cli/dist/utils/process/child_test.cpp Thu Jul 2 14:04:00 2020 @@ -272,7 +272,7 @@ do_inherit_test(const char* fork_stdout, ::close(fd); } - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( child_simple_function< 123, 'Z' >, fs::path(fork_stdout), fs::path(fork_stderr)); const process::status status = child->wait(); @@ -303,7 +303,7 @@ child__fork_capture__ok(Hook hook) { std::cout << "This unflushed message should not propagate to the child"; std::cerr << "This unflushed message should not propagate to the child"; - std::auto_ptr< process::child > child = process::child::fork_capture(hook); + std::unique_ptr< process::child > child = process::child::fork_capture(hook); std::cout << std::endl; std::cerr << std::endl; @@ -362,7 +362,7 @@ ATF_TEST_CASE_BODY(child__fork_capture__ const pid_t parent_pid = ::getpid(); atf::utils::create_file("to-not-be-deleted", ""); - std::auto_ptr< process::child > child = process::child::fork_capture( + std::unique_ptr< process::child > child = process::child::fork_capture( child_return); if (::getpid() != parent_pid) { // If we enter this clause, it is because the hook returned. @@ -382,7 +382,7 @@ ATF_TEST_CASE_BODY(child__fork_capture__ const pid_t parent_pid = ::getpid(); atf::utils::create_file("to-not-be-deleted", ""); try { - std::auto_ptr< process::child > child = process::child::fork_capture( + std::unique_ptr< process::child > child = process::child::fork_capture( child_raise_exception< int, 123 >); const process::status status = child->wait(); ATF_REQUIRE(status.signaled()); @@ -418,7 +418,7 @@ ATF_TEST_CASE_BODY(child__fork_files__ok const fs::path file1("file1.txt"); const fs::path file2("file2.txt"); - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( child_simple_function< 15, 'Z' >, file1, file2); const process::status status = child->wait(); ATF_REQUIRE(status.exited()); @@ -441,7 +441,7 @@ ATF_TEST_CASE_BODY(child__fork_files__ok atf::utils::create_file(filea.str(), "Initial stdout\n"); atf::utils::create_file(fileb.str(), "Initial stderr\n"); - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( child_simple_functor(16, "a functor"), filea, fileb); const process::status status = child->wait(); ATF_REQUIRE(status.exited()); @@ -481,7 +481,7 @@ ATF_TEST_CASE_BODY(child__fork_files__fo const pid_t parent_pid = ::getpid(); atf::utils::create_file("to-not-be-deleted", ""); - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( child_return, fs::path("out"), fs::path("err")); if (::getpid() != parent_pid) { // If we enter this clause, it is because the hook returned. @@ -501,7 +501,7 @@ ATF_TEST_CASE_BODY(child__fork_files__fo const pid_t parent_pid = ::getpid(); atf::utils::create_file("to-not-be-deleted", ""); try { - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( child_raise_exception< int, 123 >, fs::path("out"), fs::path("err")); const process::status status = child->wait(); @@ -539,7 +539,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(child__fork_f ATF_TEST_CASE_BODY(child__fork_files__create_stdout_fail) { process::detail::syscall_open = open_fail< ENOENT >; - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( child_simple_function< 1, 'A' >, fs::path("raise-error"), fs::path("created")); const process::status status = child->wait(); @@ -554,7 +554,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(child__fork_f ATF_TEST_CASE_BODY(child__fork_files__create_stderr_fail) { process::detail::syscall_open = open_fail< ENOENT >; - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( child_simple_function< 1, 'A' >, fs::path("created"), fs::path("raise-error")); const process::status status = child->wait(); @@ -574,7 +574,7 @@ ATF_TEST_CASE_BODY(child__spawn__absolut const fs::path program = get_helpers(this); INV(program.is_absolute()); - std::auto_ptr< process::child > child = process::child::spawn_files( + std::unique_ptr< process::child > child = process::child::spawn_files( program, args, fs::path("out"), fs::path("err")); const process::status status = child->wait(); @@ -593,7 +593,7 @@ ATF_TEST_CASE_BODY(child__spawn__relativ ATF_REQUIRE(::mkdir("root", 0755) != -1); ATF_REQUIRE(::symlink(get_helpers(this).c_str(), "root/helpers") != -1); - std::auto_ptr< process::child > child = process::child::spawn_files( + std::unique_ptr< process::child > child = process::child::spawn_files( fs::path("root/helpers"), args, fs::path("out"), fs::path("err")); const process::status status = child->wait(); @@ -611,7 +611,7 @@ ATF_TEST_CASE_BODY(child__spawn__basenam ATF_REQUIRE(::symlink(get_helpers(this).c_str(), "helpers") != -1); - std::auto_ptr< process::child > child = process::child::spawn_files( + std::unique_ptr< process::child > child = process::child::spawn_files( fs::path("helpers"), args, fs::path("out"), fs::path("err")); const process::status status = child->wait(); @@ -631,7 +631,7 @@ ATF_TEST_CASE_BODY(child__spawn__no_path const fs::path helpers = get_helpers(this); utils::setenv("PATH", helpers.branch_path().c_str()); - std::auto_ptr< process::child > child = process::child::spawn_capture( + std::unique_ptr< process::child > child = process::child::spawn_capture( fs::path(helpers.leaf_name()), args); std::string line; @@ -649,7 +649,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(child__spawn_ ATF_TEST_CASE_BODY(child__spawn__no_args) { std::vector< std::string > args; - std::auto_ptr< process::child > child = process::child::spawn_capture( + std::unique_ptr< process::child > child = process::child::spawn_capture( get_helpers(this), args); std::string line; @@ -670,7 +670,7 @@ ATF_TEST_CASE_BODY(child__spawn__some_ar args.push_back("print-args"); args.push_back("foo"); args.push_back(" bar baz "); - std::auto_ptr< process::child > child = process::child::spawn_capture( + std::unique_ptr< process::child > child = process::child::spawn_capture( get_helpers(this), args); std::string line; @@ -696,7 +696,7 @@ ATF_TEST_CASE_WITHOUT_HEAD(child__spawn_ ATF_TEST_CASE_BODY(child__spawn__missing_program) { std::vector< std::string > args; - std::auto_ptr< process::child > child = process::child::spawn_capture( + std::unique_ptr< process::child > child = process::child::spawn_capture( fs::path("a/b/c"), args); std::string line; @@ -714,7 +714,7 @@ ATF_TEST_CASE_BODY(child__spawn__missing ATF_TEST_CASE_WITHOUT_HEAD(child__pid); ATF_TEST_CASE_BODY(child__pid) { - std::auto_ptr< process::child > child = process::child::fork_capture( + std::unique_ptr< process::child > child = process::child::fork_capture( child_write_pid); const int pid = child->pid(); Index: src/external/bsd/kyua-cli/dist/utils/process/fdstream.hpp diff -u src/external/bsd/kyua-cli/dist/utils/process/fdstream.hpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/process/fdstream.hpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/process/fdstream.hpp:1.1.1.1 Sat Feb 23 12:34:06 2013 +++ src/external/bsd/kyua-cli/dist/utils/process/fdstream.hpp Thu Jul 2 14:04:00 2020 @@ -50,7 +50,7 @@ class ifdstream : public std::istream, n struct impl; /// Pointer to the shared internal implementation. - std::auto_ptr< impl > _pimpl; + std::unique_ptr< impl > _pimpl; public: explicit ifdstream(const int); Index: src/external/bsd/kyua-cli/dist/utils/process/systembuf.hpp diff -u src/external/bsd/kyua-cli/dist/utils/process/systembuf.hpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/process/systembuf.hpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/process/systembuf.hpp:1.1.1.1 Sat Feb 23 12:34:07 2013 +++ src/external/bsd/kyua-cli/dist/utils/process/systembuf.hpp Thu Jul 2 14:04:00 2020 @@ -50,7 +50,7 @@ class systembuf : public std::streambuf, struct impl; /// Pointer to the shared internal implementation. - std::auto_ptr< impl > _pimpl; + std::unique_ptr< impl > _pimpl; protected: int_type underflow(void); Index: src/external/bsd/kyua-cli/dist/utils/signals/interrupts.cpp diff -u src/external/bsd/kyua-cli/dist/utils/signals/interrupts.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/signals/interrupts.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/signals/interrupts.cpp:1.1.1.1 Sat Feb 23 12:34:07 2013 +++ src/external/bsd/kyua-cli/dist/utils/signals/interrupts.cpp Thu Jul 2 14:04:01 2020 @@ -60,11 +60,11 @@ static pids_set pids_to_kill; /// Programmer status for the SIGHUP signal. -static std::auto_ptr< signals::programmer > sighup_handler; +static std::unique_ptr< signals::programmer > sighup_handler; /// Programmer status for the SIGINT signal. -static std::auto_ptr< signals::programmer > sigint_handler; +static std::unique_ptr< signals::programmer > sigint_handler; /// Programmer status for the SIGTERM signal. -static std::auto_ptr< signals::programmer > sigterm_handler; +static std::unique_ptr< signals::programmer > sigterm_handler; /// Signal mask to restore after exiting a signal inhibited section. @@ -130,17 +130,17 @@ setup_handlers(void) // Create the handlers on the stack first so that, if any of them fails, the // stack unwinding cleans things up. - std::auto_ptr< signals::programmer > tmp_sighup_handler( + std::unique_ptr< signals::programmer > tmp_sighup_handler( new signals::programmer(SIGHUP, signal_handler)); - std::auto_ptr< signals::programmer > tmp_sigint_handler( + std::unique_ptr< signals::programmer > tmp_sigint_handler( new signals::programmer(SIGINT, signal_handler)); - std::auto_ptr< signals::programmer > tmp_sigterm_handler( + std::unique_ptr< signals::programmer > tmp_sigterm_handler( new signals::programmer(SIGTERM, signal_handler)); // Now, update the global pointers, which is an operation that cannot fail. - sighup_handler = tmp_sighup_handler; - sigint_handler = tmp_sigint_handler; - sigterm_handler = tmp_sigterm_handler; + sighup_handler = std::move(tmp_sighup_handler); + sigint_handler = std::move(tmp_sigint_handler); + sigterm_handler = std::move(tmp_sigterm_handler); } Index: src/external/bsd/kyua-cli/dist/utils/signals/interrupts_test.cpp diff -u src/external/bsd/kyua-cli/dist/utils/signals/interrupts_test.cpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/signals/interrupts_test.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/signals/interrupts_test.cpp:1.1.1.1 Sat Feb 23 12:34:07 2013 +++ src/external/bsd/kyua-cli/dist/utils/signals/interrupts_test.cpp Thu Jul 2 14:04:01 2020 @@ -158,9 +158,9 @@ ATF_TEST_CASE_BODY(interrupts_handler__s ATF_TEST_CASE_WITHOUT_HEAD(interrupts_handler__kill_children); ATF_TEST_CASE_BODY(interrupts_handler__kill_children) { - std::auto_ptr< process::child > child1(process::child::fork_capture( + std::unique_ptr< process::child > child1(process::child::fork_capture( pause_child)); - std::auto_ptr< process::child > child2(process::child::fork_capture( + std::unique_ptr< process::child > child2(process::child::fork_capture( pause_child)); signals::interrupts_handler interrupts; Index: src/external/bsd/kyua-cli/dist/utils/signals/programmer.hpp diff -u src/external/bsd/kyua-cli/dist/utils/signals/programmer.hpp:1.1.1.1 src/external/bsd/kyua-cli/dist/utils/signals/programmer.hpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/signals/programmer.hpp:1.1.1.1 Sat Feb 23 12:34:07 2013 +++ src/external/bsd/kyua-cli/dist/utils/signals/programmer.hpp Thu Jul 2 14:04:01 2020 @@ -49,7 +49,7 @@ class programmer : noncopyable { struct impl; /// Pointer to the shared internal implementation. - std::auto_ptr< impl > _pimpl; + std::unique_ptr< impl > _pimpl; public: programmer(const int, const handler_type); Index: src/external/bsd/kyua-cli/dist/utils/signals/misc_test.cpp diff -u src/external/bsd/kyua-cli/dist/utils/signals/misc_test.cpp:1.1.1.2 src/external/bsd/kyua-cli/dist/utils/signals/misc_test.cpp:1.2 --- src/external/bsd/kyua-cli/dist/utils/signals/misc_test.cpp:1.1.1.2 Fri Oct 18 23:40:44 2013 +++ src/external/bsd/kyua-cli/dist/utils/signals/misc_test.cpp Thu Jul 2 14:04:01 2020 @@ -88,7 +88,7 @@ ATF_TEST_CASE_BODY(reset__ok) { // TODO(jmmv): We should have a child type that inherits both stdout and // stderr so that we do not have to specify files. - std::auto_ptr< process::child > child = process::child::fork_files( + std::unique_ptr< process::child > child = process::child::fork_files( program_reset_raise, fs::path("stdout.txt"), fs::path("stderr.txt")); process::status status = child->wait(); ATF_REQUIRE(status.signaled());