storage: s/strtok_r()/lxc_iterate_parts()/g

parent 60ca579b
...@@ -567,15 +567,13 @@ struct lxc_storage *storage_create(const char *dest, const char *type, ...@@ -567,15 +567,13 @@ struct lxc_storage *storage_create(const char *dest, const char *type,
/* -B lvm,dir */ /* -B lvm,dir */
if (strchr(type, ',')) { if (strchr(type, ',')) {
char *dup, *token; char *dup, *token;
char *saveptr = NULL;
size_t len; size_t len;
len = strlen(type); len = strlen(type);
dup = alloca(len + 1); dup = alloca(len + 1);
(void)strlcpy(dup, type, len + 1); (void)strlcpy(dup, type, len + 1);
for (token = strtok_r(dup, ",", &saveptr); token; lxc_iterate_parts(token, dup, ",") {
token = strtok_r(NULL, ",", &saveptr)) {
bdev = do_storage_create(dest, token, cname, specs); bdev = do_storage_create(dest, token, cname, specs);
if (bdev) if (bdev)
return bdev; return bdev;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment