1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

cryptsetup: fix build with -Db_ndebug=true

```
 ...
 ../src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-fido2.c:33:13: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
         int r;
             ^
 1 error generated.
 ...
 ../src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-pkcs11.c:34:13: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
         int r;
             ^
 1 error generated.
 ninja: build stopped: subcommand failed.
 + fatal ''\''meson compile'\'' failed with -Db_ndebug=true'
```

(cherry picked from commit dfe7cfe4fbd4d2de99a8e97919dd5f7cdef1a1c5)
This commit is contained in:
Frantisek Sumsal 2022-05-21 17:30:51 +02:00 committed by Luca Boccassi
parent 0ab5e9fe98
commit 6cd1b11d02
2 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,8 @@ _public_ int cryptsetup_token_open_pin(
/* This must not fail at this moment (internal error) */
r = crypt_token_json_get(cd, token, &json);
assert(token == r);
/* Use assert_se() here to avoid emitting warning with -DNDEBUG */
assert_se(token == r);
assert(json);
if (pin && memchr(pin, 0, pin_size - 1))

View File

@ -38,7 +38,8 @@ _public_ int cryptsetup_token_open_pin(
/* This must not fail at this moment (internal error) */
r = crypt_token_json_get(cd, token, &json);
assert(token == r);
/* Use assert_se() here to avoid emitting warning with -DNDEBUG */
assert_se(token == r);
assert(json);
return acquire_luks2_key(cd, json, usrptr, pin, pin_size, password, password_len);