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_option.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_option.c')
-rw-r--r-- | cmd_option.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd_option.c b/cmd_option.c index 86768e5d..6ce34016 100644 --- a/cmd_option.c +++ b/cmd_option.c @@ -20,6 +20,7 @@ #include "cmds.h" #include "libbcachefs.h" +#include "libbcachefs/errcode.h" #include "libbcachefs/opts.h" #include "libbcachefs/super-io.h" @@ -64,7 +65,7 @@ int cmd_set_option(int argc, char *argv[]) struct bch_fs *c = bch2_fs_open(argv, argc, open_opts); if (IS_ERR(c)) { - fprintf(stderr, "error opening %s: %s\n", argv[0], strerror(-PTR_ERR(c))); + fprintf(stderr, "error opening %s: %s\n", argv[0], bch2_err_str(PTR_ERR(c))); exit(EXIT_FAILURE); } |