From: Lennart Poettering Date: Wed, 19 Mar 2025 09:05:25 +0000 (+0100) Subject: veritysetup-generator: exit on first error X-Git-Tag: v258-rc1~1046^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eedd0b9886e105330ecfb174b445413053aa220f;p=thirdparty%2Fsystemd.git veritysetup-generator: exit on first error --- diff --git a/src/veritysetup/veritysetup-generator.c b/src/veritysetup/veritysetup-generator.c index 520cf097e54..cc489b1b651 100644 --- a/src/veritysetup/veritysetup-generator.c +++ b/src/veritysetup/veritysetup-generator.c @@ -65,14 +65,11 @@ static int create_special_device( /* if one of them is missing however, the data is simply incomplete and this is an error */ if (!roothash) - log_error("Verity information for %s incomplete, root hash unspecified.", name); + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, root hash unspecified.", name); if (!data_what) - log_error("Verity information for %s incomplete, data device unspecified.", name); + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, data device unspecified.", name); if (!hash_what) - log_error("Verity information for %s incomplete, hash device unspecified.", name); - - if (!roothash || !data_what || !hash_what) - return -EINVAL; + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, hash device unspecified.", name); _cleanup_free_ char *service = NULL; r = unit_name_build("systemd-veritysetup", name, ".service", &service);