Commits

Anonymous committed 64d428d

fix partition_align_type

  • Participants
  • Parent commits 208b795

Comments (0)

Files changed (4)

 				align_type = string_to_align_type(optarg);
 				if (align_type == ALIGNMENT_INVALID)
 					print_usage();
-				partition_align_type = align_type;
+				current_partition_align_type = align_type;
 				break;
 			case 'u':
 				unit = ped_unit_get_by_name(optarg);
  * handled by fdisk.c and cfdisk.c.
  */
 
-AlignType partition_align_type = ALIGNMENT_NONE;
+AlignType current_partition_align_type = ALIGNMENT_OPTIMAL;
+
 
 /* Here we store the struct with interface functions */
 static UICalls *uiquery;
     ALIGNMENT_OPTIMAL
 };
 
-extern AlignType partition_align_type;
+extern int compat_mode;
+extern AlignType current_partition_align_type;
+
+/* Christian <mail.kristian@yahoo.it>
+	 We use  this macro to know how  to align the partitions.  
+	 In this way, We use  "ALIGNMENT_CYLINDER" when 
+	 compat_mode is active. */
+#define partition_align_type (compat_mode ? ALIGNMENT_CYLINDER : current_partition_align_type)
 
 /* Structures used to specify partition position */
 typedef struct _SectPos SectPos;
 	      fdisk_usage_msg();
 	      return 0;
 	  }
-      partition_align_type = align_type;
+      current_partition_align_type = align_type;
       break;
 	case 'u':
 	  ped_unit_set_default(PED_UNIT_SECTOR);