btrfs-progs: image: return negativer error from all paths in mdrestore_init
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
3956c16d0b
commit
9287b8630c
|
@ -1880,8 +1880,11 @@ static int mdrestore_init(struct mdrestore_struct *mdres,
|
||||||
for (i = 0; i < num_threads; i++) {
|
for (i = 0; i < num_threads; i++) {
|
||||||
ret = pthread_create(mdres->threads + i, NULL, restore_worker,
|
ret = pthread_create(mdres->threads + i, NULL, restore_worker,
|
||||||
mdres);
|
mdres);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
/* pthread_create returns errno directly */
|
||||||
|
ret = -ret;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ret)
|
if (ret)
|
||||||
mdrestore_destroy(mdres, i + 1);
|
mdrestore_destroy(mdres, i + 1);
|
||||||
|
|
Loading…
Reference in New Issue