From 77b5ff9dc42255111ef940053cc179556e828949 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Dec 15 2020 09:45:26 +0000 Subject: cryptsetup: don't use %m if there's no error to show We are not the ones receiving an error here, but the ones generating it, hence we shouldn't show it with %m, that's just confusing, as it suggests we received an error from some other call. (cherry-picked from commit 2abe64666e544be6499f870618185f8819b4c152) Related: #1656869 patch_name: 0049-cryptsetup-don-t-use-m-if-there-s-no-error-to-show.patch present_in_specfile: true location_in_specfile: 49 squash_commits: true --- diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index 8c7a76e..52391bd 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -152,8 +152,10 @@ static int create_disk( return log_oom(); } - if (keydev && !password) - return log_error_errno(-EINVAL, "Keydev is specified, but path to the password file is missing: %m"); + if (keydev && !password) { + log_error("Key device is specified, but path to the password file is missing."); + return -EINVAL; + } r = generator_open_unit_file(arg_dest, NULL, n, &f); if (r < 0)