sfdisk: exit with error if rereading partition table fails

Use the return value of fdisk_reread_partition_table in write_changes so that
sfdisk exits with error if re-reading the partition table fails.

Signed-off-by: Victor Dodon <dodonvictor@gmail.com>
This commit is contained in:
Victor Dodon 2016-04-21 00:24:58 -07:00 committed by Karel Zak
parent 832bbc73b2
commit 14f644f386
1 changed files with 1 additions and 1 deletions

View File

@ -535,7 +535,7 @@ static int write_changes(struct sfdisk *sf)
rc = move_partition_data(sf, sf->partno, sf->orig_pa);
if (!rc) {
fdisk_info(sf->cxt, _("\nThe partition table has been altered."));
fdisk_reread_partition_table(sf->cxt);
rc = fdisk_reread_partition_table(sf->cxt);
}
}
if (!rc)