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_format.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_format.c')
-rw-r--r-- | cmd_format.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd_format.c b/cmd_format.c index 4debc285..9feb3345 100644 --- a/cmd_format.c +++ b/cmd_format.c @@ -24,6 +24,7 @@ #include "libbcachefs.h" #include "crypto.h" #include "libbcachefs/darray.h" +#include "libbcachefs/errcode.h" #include "libbcachefs/opts.h" #include "libbcachefs/super-io.h" #include "libbcachefs/util.h" @@ -270,7 +271,7 @@ int cmd_format(int argc, char *argv[]) mount_opts); if (IS_ERR(c)) die("error opening %s: %s", device_paths.data[0], - strerror(-PTR_ERR(c))); + bch2_err_str(PTR_ERR(c))); bch2_fs_stop(c); } @@ -336,7 +337,7 @@ int cmd_show_super(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)); struct printbuf buf = PRINTBUF; |