mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-03-10 00:00:04 +03:00
Fix bcachefs device remove --by-id
That's not how you parse an integer in C... Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
80846e9c28
commit
41dc1733f1
@ -172,10 +172,15 @@ int cmd_device_remove(int argc, char *argv[])
|
||||
if (!path)
|
||||
die("Please supply filesystem to remove device from");
|
||||
|
||||
dev_idx = (intptr_t) arg_pop();
|
||||
if (!dev_idx)
|
||||
char *dev_str = arg_pop();
|
||||
if (!dev_str)
|
||||
die("Please supply device id");
|
||||
|
||||
errno = 0;
|
||||
dev_idx = strtoul(dev_str, NULL, 10);
|
||||
if (errno)
|
||||
die("Error parsing device id: %m");
|
||||
|
||||
fs = bcache_fs_open(path);
|
||||
} else {
|
||||
char *dev = arg_pop();
|
||||
|
Loading…
Reference in New Issue
Block a user