diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2015-03-27 08:18:11 -0400 |
---|---|---|
committer | Thomas Backlund <tmb@mageia.org> | 2015-03-27 22:32:39 +0159 |
commit | 8ec5cb448e1d5ad539c2ee5caf25e67f20d63391 (patch) | |
tree | c4bd8779d621da39e3ac965153a98ccf248ce60b | |
parent | 30d6333475e8826ce7819be8e1063516f18035e7 (diff) | |
download | drakx-8ec5cb448e1d5ad539c2ee5caf25e67f20d63391.tar drakx-8ec5cb448e1d5ad539c2ee5caf25e67f20d63391.tar.gz drakx-8ec5cb448e1d5ad539c2ee5caf25e67f20d63391.tar.bz2 drakx-8ec5cb448e1d5ad539c2ee5caf25e67f20d63391.tar.xz drakx-8ec5cb448e1d5ad539c2ee5caf25e67f20d63391.zip |
extract mapping string to flag
needed for next commit
-rwxr-xr-x | perl-install/c/stuff.xs.pl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 662831bc9..95e0c0411 100755 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -118,6 +118,16 @@ int length_of_space_padded(char *str, int len) { return len; } +PedPartitionFlag string_to_pedpartflag(char*type) { + PedPartitionFlag flag = 0; + if (!strcmp(type, "ESP")) { + flag = PED_PARTITION_ESP; + } else { + printf("set_partition_flag: unknown type"); + } + return flag; +} + MODULE = c::stuff PACKAGE = c::stuff '; @@ -608,12 +618,7 @@ set_partition_flag(char * device_path, int part_number, char *type) if (!part) { printf("set_partition_flag: failed to find partition\n"); } else { - PedPartitionFlag flag = 0; - if (!strcmp(type, "ESP")) { - flag = PED_PARTITION_ESP; - } else { - printf("set_partition_flag: unknown type\n"); - } + PedPartitionFlag flag = string_to_pedpartflag(type); if (flag) RETVAL=ped_partition_set_flag(part, flag, 1); if (RETVAL) |