Skip to content

Commit 8772a4d

Browse files
authored
Merge pull request torvalds#427 from YorikSar/let-cptofs-fail
cptofs: Don't overwrite failure with umount return value
2 parents 9b72637 + 394f2a4 commit 8772a4d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/lkl/cptofs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ int copy_one(const char *src, const char *mpoint, const char *dst)
560560
int main(int argc, char **argv)
561561
{
562562
struct lkl_disk disk;
563-
long ret;
563+
long ret, umount_ret;
564564
int i;
565565
char mpoint[32];
566566
unsigned int disk_id;
@@ -613,7 +613,9 @@ int main(int argc, char **argv)
613613
break;
614614
}
615615

616-
ret = lkl_umount_dev(disk_id, cla.part, 0, 1000);
616+
umount_ret = lkl_umount_dev(disk_id, cla.part, 0, 1000);
617+
if (ret == 0)
618+
ret = umount_ret;
617619

618620
out_close:
619621
close(disk.fd);

0 commit comments

Comments
 (0)