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_list.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_list.c')
-rw-r--r-- | cmd_list.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -67,7 +67,7 @@ static void list_btree_formats(struct bch_fs *c, enum btree_id btree_id, unsigne bch2_trans_iter_exit(&trans, &iter); if (ret) - die("error %s walking btree nodes", strerror(-ret)); + die("error %s walking btree nodes", bch2_err_str(ret)); bch2_trans_exit(&trans); printbuf_exit(&buf); @@ -96,7 +96,7 @@ static void list_nodes(struct bch_fs *c, enum btree_id btree_id, unsigned level, bch2_trans_iter_exit(&trans, &iter); if (ret) - die("error %s walking btree nodes", strerror(-ret)); + die("error %s walking btree nodes", bch2_err_str(ret)); bch2_trans_exit(&trans); printbuf_exit(&buf); @@ -232,7 +232,7 @@ static void list_nodes_ondisk(struct bch_fs *c, enum btree_id btree_id, unsigned bch2_trans_iter_exit(&trans, &iter); if (ret) - die("error %s walking btree nodes", strerror(-ret)); + die("error %s walking btree nodes", bch2_err_str(ret)); bch2_trans_exit(&trans); printbuf_exit(&buf); @@ -270,7 +270,7 @@ static void list_nodes_keys(struct bch_fs *c, enum btree_id btree_id, unsigned l bch2_trans_iter_exit(&trans, &iter); if (ret) - die("error %s walking btree nodes", strerror(-ret)); + die("error %s walking btree nodes", bch2_err_str(ret)); bch2_trans_exit(&trans); printbuf_exit(&buf); @@ -376,7 +376,7 @@ int cmd_list(int argc, char *argv[]) struct bch_fs *c = bch2_fs_open(argv, argc, opts); if (IS_ERR(c)) - die("error opening %s: %s", argv[0], strerror(-PTR_ERR(c))); + die("error opening %s: %s", argv[0], bch2_err_str(PTR_ERR(c))); for (btree_id = btree_id_start; |