summaryrefslogtreecommitdiffstats
path: root/perl-install/c/stuff.xs.pl
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-03-27 08:18:11 -0400
committerThomas Backlund <tmb@mageia.org>2015-03-27 22:32:39 +0159
commit8ec5cb448e1d5ad539c2ee5caf25e67f20d63391 (patch)
treec4bd8779d621da39e3ac965153a98ccf248ce60b /perl-install/c/stuff.xs.pl
parent30d6333475e8826ce7819be8e1063516f18035e7 (diff)
downloaddrakx-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
Diffstat (limited to 'perl-install/c/stuff.xs.pl')
-rwxr-xr-xperl-install/c/stuff.xs.pl17
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)