return str;
}
-void *xcalloc(size_t count, size_t size)
-{
- void *p = calloc(count, size);
-
- if (!p)
- die("insufficient memory");
-
- return p;
-}
-
-void *xmalloc(size_t size)
-{
- void *p = malloc(size);
-
- if (!p)
- die("insufficient memory");
-
- memset(p, 0, size);
- return p;
-}
-
-void *xrealloc(void *p, size_t size)
-{
- p = realloc(p, size);
- if (!p)
- die("insufficient memory");
-
- return p;
-}
-
void xpread(int fd, void *buf, size_t count, off_t offset)
{
while (count) {
ret.pos = bpos_parse(s);
return ret;
}
+
+darray_str get_or_split_cmdline_devs(int argc, char *argv[])
+{
+ darray_str ret = {};
+
+ if (argc == 1) {
+ bch2_split_devs(argv[0], &ret);
+ } else {
+ for (unsigned i = 0; i < argc; i++)
+ darray_push(&ret, strdup(argv[i]));
+ }
+
+ return ret;
+}