From d712f69f5f769c5eaada3c1f76419abfb7b6f7ed Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 10 Feb 2020 22:09:59 +0300 Subject: Add builtins support for $process.run*() functions --- libbuild2/utility.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'libbuild2/utility.cxx') diff --git a/libbuild2/utility.cxx b/libbuild2/utility.cxx index 7fa0ef1..faffd66 100644 --- a/libbuild2/utility.cxx +++ b/libbuild2/utility.cxx @@ -313,6 +313,31 @@ namespace build2 fail << "io error reading " << args[0] << " output: " << e << endf; } + fdpipe + open_pipe () + { + try + { + return fdopen_pipe (); + } + catch (const io_error& e) + { + fail << "unable to open pipe: " << e << endf; + } + } + + auto_fd + open_dev_null () + { + try + { + return fdnull (); + } + catch (const io_error& e) + { + fail << "unable to open null device: " << e << endf; + } + } const string empty_string; const path empty_path; -- cgit v1.1