[build2] Official build2 Fedora packages
boris at codesynthesis.com
Mon Jul 8 13:50:36 UTC 2019
Boris Kolpackov <boris at codesynthesis.com> writes:
> > 2. I noticed that libbutl in a few places[4,5] will invoke exit(3)
> > directly. I'm not sure if this is intentional, but usually a library
> > should allow the user executable to decide what to do in the case of
> > an error, so perhaps in this case it makes sense to just re-throw the
> > exception and let the executable catch it (or not).
> In the two cases you refer, exit() is called inside the child process
> that failed to exec(). Since the program may be multi-threaded, this
> is probably the safest thing to do.
> > This seems to be what is done in e.g. b_info for a similar use-case.
> Actually, I think that's a bug. We will look into it.
Ok, we've audited the process_error exception handling: the cases which
looked suspicious (no check for the child flag) all use the higher-level
process running interface which handles child errors internally printing
diagnostics to stderr and calling exit(1) (see libbutl/process-run.cxx
More information about the users