Anonymous avatar Anonymous committed 22e4df4

warning when --align is used in compatibility mode

Comments (0)

Files changed (1)

 #endif /* GNU_EXT */
   { "interactive", no_argument, NULL, 'i', "where necessary, prompts for user intervention"},
   { "script", no_argument, NULL, 'p', "never prompts for user intervention"},
+#ifdef GNU_EXT
   { "align", required_argument, NULL, 'A', "specify align to be none, cyl, min or opt"},
+#endif
   { "sector-units", no_argument, NULL, 'u', "use sectors instead of cylinder as a default unit"},
   { "sector-size", required_argument, NULL, 'b', "specify the sector size in bytes"},
   { "cylinders", required_argument, NULL, 'C', "specify the number of cylinders, actually does nothing"},
 	case 't':
 	  print_partition_types();
 	  break;
+#ifdef GNU_EXT
 	case 'A':
 	  align_type = string_to_align_type(optarg);
 	  if (align_type == ALIGNMENT_INVALID) {
 	      fdisk_usage_msg();
 	      return 0;
 	  }
+
       current_partition_align_type = align_type;
       break;
+#endif
 	case 'u':
 	  ped_unit_set_default(PED_UNIT_SECTOR);
 	  cylinder_unit = 0;
   *argv_ptr += optind;
   
   free(options_table);
-  
+ 
+	if(compat_mode && align_type != ALIGNMENT_CYLINDER)
+		{
+			fprintf(stderr, _("Warning: alignment option is ignored in "
+												"util-linux compatibile mode. Switch to cylinder alignment.\n"));
+		}	
+
   return 1;
 }
 
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.