Anonymous avatar Anonymous committed 64d428d

fix partition_align_type

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);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.