From 5389747f4fff27f85404c96ae969c0c1c7924d76 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Apr 2022 11:01:04 +0200 Subject: Add butl::move_only_function[_ex] similar to C++23 std::move_only_function --- libbutl/process.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libbutl/process.cxx') diff --git a/libbutl/process.cxx b/libbutl/process.cxx index 5d7710e..5523b96 100644 --- a/libbutl/process.cxx +++ b/libbutl/process.cxx @@ -635,6 +635,10 @@ namespace butl { // Child. // + // NOTE: make sure not to call anything that may acquire a mutex that + // could be already acquired in another thread, most notably + // malloc(). @@ What about exceptions (all the fail() calls)? + // Duplicate the user-supplied (fd > -1) or the created pipe descriptor // to the standard stream descriptor (read end for STDIN_FILENO, write // end otherwise). Close the pipe afterwards. @@ -694,6 +698,9 @@ namespace butl try { + // @@ TODO: redo without allocation (PATH_MAX?) Maybe + // also using C API to avoid exceptions. + // if (e != nullptr) setenv (string (v, e - v), e + 1); else @@ -701,6 +708,8 @@ namespace butl } catch (const system_error& e) { + // @@ Should we assume this cannot throw? + // throw process_child_error (e.code ().value ()); } } -- cgit v1.1