diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-19 16:05:54 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-19 16:05:54 -0500 |
commit | 1eae1d718c228fb1fc3e7a47a830a2c71f84b5cf (patch) | |
tree | da47d7b5b6591ca45951eb63bdee21a313ce8aec /cmd_key.c | |
parent | e2670a38d1ad6038d64687cb1d585349508e06d7 (diff) |
Use bch2_err_str() instead of strerror()
This correctly prints out our private error codes.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'cmd_key.c')
-rw-r--r-- | cmd_key.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -55,7 +55,7 @@ int cmd_unlock(int argc, char *argv[]) struct bch_sb_handle sb; int ret = bch2_read_super(dev, &opts, &sb); if (ret) - die("Error opening %s: %s", dev, strerror(-ret)); + die("Error opening %s: %s", dev, bch2_err_str(ret)); if (!bch2_sb_is_encrypted(sb.sb)) die("%s is not encrypted", dev); @@ -90,7 +90,7 @@ int cmd_set_passphrase(int argc, char *argv[]) c = bch2_fs_open(argv + 1, argc - 1, opts); if (IS_ERR(c)) - die("Error opening %s: %s", argv[1], strerror(-PTR_ERR(c))); + die("Error opening %s: %s", argv[1], bch2_err_str(PTR_ERR(c))); struct bch_sb_field_crypt *crypt = bch2_sb_get_crypt(c->disk_sb.sb); if (!crypt) @@ -127,7 +127,7 @@ int cmd_remove_passphrase(int argc, char *argv[]) opt_set(opts, nostart, true); c = bch2_fs_open(argv + 1, argc - 1, opts); if (IS_ERR(c)) - die("Error opening %s: %s", argv[1], strerror(-PTR_ERR(c))); + die("Error opening %s: %s", argv[1], bch2_err_str(PTR_ERR(c))); struct bch_sb_field_crypt *crypt = bch2_sb_get_crypt(c->disk_sb.sb); if (!crypt) |