"Not booted with EFI\n\n",
ansi_underline(), ansi_normal());
- if (arg_esp_path) {
- k = status_binaries(arg_esp_path, esp_uuid);
- if (k < 0)
- r = k;
- }
+ if (arg_esp_path)
+ RET_GATHER(r, status_binaries(arg_esp_path, esp_uuid));
- if (!arg_root && is_efi_boot()) {
- k = status_variables();
- if (k < 0)
- r = k;
- }
+ if (!arg_root && is_efi_boot())
+ RET_GATHER(r, status_variables());
if (arg_esp_path || arg_xbootldr_path) {
_cleanup_(boot_config_free) BootConfig config = BOOT_CONFIG_NULL;
k = boot_config_load_and_select(&config,
arg_esp_path, esp_devid,
arg_xbootldr_path, xbootldr_devid);
- if (k < 0)
- r = k;
- else {
- k = status_entries(&config,
- arg_esp_path, esp_uuid,
- arg_xbootldr_path, xbootldr_uuid);
- if (k < 0)
- r = k;
- }
+ RET_GATHER(r, k);
+
+ if (k >= 0)
+ RET_GATHER(r,
+ status_entries(&config,
+ arg_esp_path, esp_uuid,
+ arg_xbootldr_path, xbootldr_uuid));
}
return r;
#include "bootctl.h"
#include "bootctl-util.h"
+#include "errno-util.h"
#include "fileio.h"
#include "stat-util.h"
#include "sync-util.h"
int sync_everything(void) {
- int ret = 0, k;
+ int r = 0, k;
if (arg_esp_path) {
k = syncfs_path(AT_FDCWD, arg_esp_path);
if (k < 0)
- ret = log_error_errno(k, "Failed to synchronize the ESP '%s': %m", arg_esp_path);
+ RET_GATHER(r, log_error_errno(k, "Failed to synchronize the ESP '%s': %m", arg_esp_path));
}
if (arg_xbootldr_path) {
k = syncfs_path(AT_FDCWD, arg_xbootldr_path);
if (k < 0)
- ret = log_error_errno(k, "Failed to synchronize $BOOT '%s': %m", arg_xbootldr_path);
+ RET_GATHER(r, log_error_errno(k, "Failed to synchronize $BOOT '%s': %m", arg_xbootldr_path));
}
- return ret;
+ return r;
}
const char *get_efi_arch(void) {