summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)