diff options
author | Karel Zak <kzak@redhat.com> | 2015-01-28 09:57:03 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2015-01-28 09:57:03 +0100 |
commit | bf031d89eabf71164f8225fe49849116be560ee5 (patch) | |
tree | 8f3d68b82cbd86fa7458ece5589ae1fbe444ea2e | |
parent | 9bd29060128fbf6c05cf3975cb5a84ce052fa237 (diff) | |
download | util-linux-playground-bf031d89eabf71164f8225fe49849116be560ee5.tar.gz |
libfdisk: support unknown partition types in sfdisk scripts
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1183234
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | disk-utils/sfdisk.c | 4 | ||||
-rw-r--r-- | libfdisk/src/script.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index f9f733b48f..997623125e 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -715,9 +715,9 @@ static int command_parttype(struct sfdisk *sf, int argc, char **argv) if (sf->backup) backup_partition_table(sf, devname); - /* parse <type> and apply yo PT */ + /* parse <type> and apply to PT */ type = fdisk_label_parse_parttype(lb, typestr); - if (!type || fdisk_parttype_is_unknown(type)) + if (!type) errx(EXIT_FAILURE, _("failed to parse %s partition type '%s'"), fdisk_label_get_name(lb), typestr); diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c index 684c014012..5a89790d70 100644 --- a/libfdisk/src/script.c +++ b/libfdisk/src/script.c @@ -697,7 +697,7 @@ static int parse_script_line(struct fdisk_script *dp, char *s) script_get_label(dp), type); free(type); - if (!pa->type || fdisk_parttype_is_unknown(pa->type)) { + if (!pa->type) { rc = -EINVAL; fdisk_unref_parttype(pa->type); pa->type = NULL; @@ -843,7 +843,7 @@ static int parse_commas_line(struct fdisk_script *dp, char *s) script_get_label(dp), str); free(str); - if (!pa->type || fdisk_parttype_is_unknown(pa->type)) { + if (!pa->type) { rc = -EINVAL; fdisk_unref_parttype(pa->type); pa->type = NULL; |