diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-11-03 00:49:14 +0300 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:37 +0200 |
commit | d933699b4dd106c227f8d07a2471d5f39f1c82af (patch) | |
tree | 4f6c6f962b4d0aaf7c5439d440f6376ebbb7deb0 /build2/test/script/builtin.cxx | |
parent | e4feb8be8bc8667b62574da521cd53ebc94b4afc (diff) |
Adopt to auto_fd introduced to libbutl fdstreams and process
Diffstat (limited to 'build2/test/script/builtin.cxx')
-rw-r--r-- | build2/test/script/builtin.cxx | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/build2/test/script/builtin.cxx b/build2/test/script/builtin.cxx index f3a0bd4..a83bb6d 100644 --- a/build2/test/script/builtin.cxx +++ b/build2/test/script/builtin.cxx @@ -11,27 +11,16 @@ using namespace butl; namespace build2 { - //@@ auto_fd handover - // - // 1. We need auto_fd in libbutl - // 2. Overload fdstream ctors for auto_fd&& (or replace? also process data - // members?) - // 3. The builtin signature then will become: - // - // static int - // echo (const strings& args, auto_fd in, auto_fd out, auto_fd err) - static int - echo (const strings& args, int in_fd, int out_fd, int err_fd) + echo (const strings& args, auto_fd, auto_fd out, auto_fd err) try { int r (0); - ofdstream cerr (err_fd); + ofdstream cerr (move (err)); try { - fdclose (in_fd); //@@ TMP - ofdstream cout (out_fd); + ofdstream cout (move (out)); for (auto b (args.begin ()), i (b), e (args.end ()); i != e; ++i) cout << (i != b ? " " : "") << *i; |