Use strjoina to avoid error handling, and openat to simplify things.
Some fixes on the way:- ferror does not set errno, so the return value was wrong in some cases- errors are propagated in more cases- EFI/systemd was created, but EFI/systemd-boot was deleted- something is always printed on error- when checking the version, comparison was done against "systemd-bo" for some reason- return value was converted from negative to EXIT_SUCCESS/EXIT_FAILURE twice, resulting in EXIT_SUCCESS all the time
d3226d7 bootctl: modernization
src/boot/bootctl.c | 846 ++++++++++++++++++----------------------------------
src/shared/util.c | 21 ++
src/shared/util.h | 1 +
3 files changed, 306 insertions(+), 562 deletions(-)
Upstream: github.com