aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/utility.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-11-08 16:27:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-11-08 16:27:56 +0200
commitca5da0f6dcbd272691f0a5e1c8030f65030cccce (patch)
treef640a8da04077dd7e988026dfa79f48d22de28cf /libbuild2/utility.ixx
parent3bc0fc4c4496c345c79734dcd6dc56d44119aebf (diff)
Restore original error/ignore_exit semantics in run<>() overloads
Diffstat (limited to 'libbuild2/utility.ixx')
-rw-r--r--libbuild2/utility.ixx52
1 files changed, 22 insertions, 30 deletions
diff --git a/libbuild2/utility.ixx b/libbuild2/utility.ixx
index 2447303..3948623 100644
--- a/libbuild2/utility.ixx
+++ b/libbuild2/utility.ixx
@@ -174,24 +174,20 @@ namespace build2
const process_env& pe,
const char* const* args,
F&& f,
- bool ignore_exit,
sha256* checksum)
{
T r;
- if (!run (dbuf,
- verbosity,
- pe, args,
- verbosity - 1,
- [&r, &f] (string& l, bool last) // Small function optimmization.
- {
- r = f (l, last);
- return r.empty ();
- },
- true /* trim */,
- ignore_exit,
- checksum))
- r = T ();
-
+ run (dbuf,
+ verbosity,
+ pe, args,
+ verbosity - 1,
+ [&r, &f] (string& l, bool last) // Small function optimmization.
+ {
+ r = f (l, last);
+ return r.empty ();
+ },
+ true /* trim */,
+ checksum);
return r;
}
@@ -232,24 +228,20 @@ namespace build2
const char* const* args,
uint16_t finish_verbosity,
F&& f,
- bool ignore_exit,
sha256* checksum)
{
T r;
- if (!run (dbuf,
- verb_never,
- pe, args,
- finish_verbosity,
- [&r, &f] (string& l, bool last)
- {
- r = f (l, last);
- return r.empty ();
- },
- true /* trim */,
- ignore_exit,
- checksum))
- r = T ();
-
+ run (dbuf,
+ verb_never,
+ pe, args,
+ finish_verbosity,
+ [&r, &f] (string& l, bool last)
+ {
+ r = f (l, last);
+ return r.empty ();
+ },
+ true /* trim */,
+ checksum);
return r;
}