Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/util-linux/fdisk.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/util-linux/fdisk.c
r3232 r3621 1103 1103 if (!g_cylinders) 1104 1104 printf(" cylinders"); 1105 printf(1106 1105 #if ENABLE_FEATURE_FDISK_WRITABLE 1107 " (settable in the extra functions menu)" 1108 #endif 1109 "\n"); 1106 puts(" (settable in the extra functions menu)"); 1107 #else 1108 bb_putchar('\n'); 1109 #endif 1110 1110 return 1; 1111 1111 } … … 1151 1151 p = pex->part_table; 1152 1152 if (!get_start_sect(p)) { 1153 p rintf("Bad offset in primary extended partition\n");1153 puts("Bad offset in primary extended partition"); 1154 1154 return; 1155 1155 } … … 1451 1451 return 0; 1452 1452 } 1453 p rintf("This disk has both DOS and BSD magic.\n"1454 "Give the 'b' command to go to BSD mode.\n");1453 puts("This disk has both DOS and BSD magic.\n" 1454 "Give the 'b' command to go to BSD mode."); 1455 1455 } 1456 1456 #endif … … 1462 1462 if (!valid_part_table_flag(MBRbuffer)) { 1463 1463 if (what == OPEN_MAIN) { 1464 p rintf("Device contains neither a valid DOS "1465 1466 "disklabel\n");1464 puts("Device contains neither a valid DOS " 1465 "partition table, nor Sun, SGI, OSF or GPT " 1466 "disklabel"); 1467 1467 #ifdef __sparc__ 1468 1468 IF_FEATURE_SUN_LABEL(create_sunlabel();) … … 1597 1597 if (value >= low && value <= high) 1598 1598 break; 1599 p rintf("Value is out of range\n");1599 puts("Value is out of range"); 1600 1600 } 1601 1601 return value; … … 1642 1642 return pno; 1643 1643 } 1644 p rintf("No partition is defined yet!\n");1644 puts("No partition is defined yet!"); 1645 1645 return -1; 1646 1646 … … 1669 1669 return pno; 1670 1670 } 1671 p rintf("All primary partitions have been defined already!\n");1671 puts("All primary partitions have been defined already!"); 1672 1672 return -1; 1673 1673 … … 1704 1704 if (dos_compatible_flag) { 1705 1705 sector_offset = g_sectors; 1706 printf("DOS Compatibility flag is set\n");1706 printf("DOS Compatibility flag is %sset\n", ""); 1707 1707 } else { 1708 1708 sector_offset = 1; 1709 printf("DOS Compatibility flag is not set\n");1709 printf("DOS Compatibility flag is %sset\n", "not "); 1710 1710 } 1711 1711 } … … 1814 1814 1815 1815 if (!sys && !LABEL_IS_SGI && !LABEL_IS_SUN) { 1816 p rintf("Type 0 means free space to many systems\n"1817 1818 "type 0 is probably unwise.\n");1816 puts("Type 0 means free space to many systems\n" 1817 "(but not to Linux). Having partitions of\n" 1818 "type 0 is probably unwise."); 1819 1819 /* break; */ 1820 1820 } … … 1822 1822 if (!LABEL_IS_SUN && !LABEL_IS_SGI) { 1823 1823 if (IS_EXTENDED(sys) != IS_EXTENDED(p->sys_ind)) { 1824 p rintf("You cannot change a partition into"1825 " an extended one or vice versa\n");1824 puts("You cannot change a partition into" 1825 " an extended one or vice versa"); 1826 1826 break; 1827 1827 } … … 1831 1831 #if ENABLE_FEATURE_SUN_LABEL 1832 1832 if (LABEL_IS_SUN && i == 2 && sys != SUN_WHOLE_DISK) 1833 p rintf("Consider leaving partition 3 "1834 1835 1836 "even Linux likes it\n\n");1833 puts("Consider leaving partition 3 " 1834 "as Whole disk (5),\n" 1835 "as SunOS/Solaris expects it and " 1836 "even Linux likes it\n"); 1837 1837 #endif 1838 1838 #if ENABLE_FEATURE_SGI_LABEL … … 1843 1843 ) 1844 1844 ) { 1845 p rintf("Consider leaving partition 9 "1846 1847 1848 "as IRIX expects it\n\n");1845 puts("Consider leaving partition 9 " 1846 "as volume header (0),\nand " 1847 "partition 11 as entire volume (6)" 1848 "as IRIX expects it\n"); 1849 1849 } 1850 1850 #endif … … 2068 2068 2069 2069 if (!wrong_p_order(NULL)) { 2070 p rintf("Ordering is already correct\n\n");2070 puts("Ordering is already correct\n"); 2071 2071 return; 2072 2072 } … … 2096 2096 fix_chain_of_logicals(); 2097 2097 2098 p rintf("Done.\n");2098 puts("Done"); 2099 2099 } 2100 2100 #endif … … 2179 2179 if (LABEL_IS_DOS && wrong_p_order(NULL)) { 2180 2180 /* FIXME */ 2181 p rintf("\nPartition table entries are not in disk order\n");2181 puts("\nPartition table entries are not in disk order"); 2182 2182 } 2183 2183 } … … 2193 2193 printf("\nDisk %s: %u heads, %u sectors, %u cylinders\n\n", 2194 2194 disk_device, g_heads, g_sectors, g_cylinders); 2195 p rintf("Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID\n");2195 puts("Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID"); 2196 2196 for (i = 0; i < g_partitions; i++) { 2197 2197 pe = &ptes[i]; … … 2420 2420 } 2421 2421 if (start > limit) { 2422 p rintf("No free sectors available\n");2422 puts("No free sectors available"); 2423 2423 if (n > 4) 2424 2424 g_partitions--; … … 2491 2491 } 2492 2492 if (LABEL_IS_AIX) { 2493 p rintf("Sorry - this fdisk cannot handle AIX disk labels.\n"2493 puts("Sorry - this fdisk cannot handle AIX disk labels.\n" 2494 2494 "If you want to add DOS-type partitions, create a new empty DOS partition\n" 2495 "table first (use 'o'). This will destroy the present disk contents. \n");2495 "table first (use 'o'). This will destroy the present disk contents."); 2496 2496 return; 2497 2497 } … … 2501 2501 2502 2502 if (!free_primary && g_partitions >= MAXIMUM_PARTS) { 2503 p rintf("The maximum number of partitions has been created\n");2503 puts("The maximum number of partitions has been created"); 2504 2504 return; 2505 2505 } … … 2509 2509 add_logical(); 2510 2510 else 2511 p rintf("You must delete some partition and add "2512 "an extended partition first \n");2511 puts("You must delete some partition and add " 2512 "an extended partition first"); 2513 2513 } else { 2514 2514 char c, line[80]; … … 2548 2548 int i; 2549 2549 2550 p rintf("Calling ioctl() to re-read partition table\n");2550 puts("Calling ioctl() to re-read partition table"); 2551 2551 sync(); 2552 2552 /* Users with slow external USB disks on a 320MHz ARM system (year 2011) … … 2559 2559 #if 0 2560 2560 if (dos_changed) 2561 p rintf(2561 puts( 2562 2562 "\nWARNING: If you have created or modified any DOS 6.x\n" 2563 2563 "partitions, please see the fdisk manual page for additional\n" 2564 "information \n");2564 "information"); 2565 2565 #endif 2566 2566 … … 2590 2590 } 2591 2591 else if (LABEL_IS_SGI) { 2592 /* no test on change? the printfbelow might be mistaken */2592 /* no test on change? the "altered" msg below might be mistaken */ 2593 2593 sgi_write_table(); 2594 2594 } … … 2602 2602 } 2603 2603 2604 p rintf("The partition table has been altered.\n");2604 puts("The partition table has been altered."); 2605 2605 reread_partition_table(1); 2606 2606 } … … 2745 2745 if (dos_compatible_flag) { 2746 2746 sector_offset = g_sectors; 2747 p rintf("Warning: setting sector offset for DOS "2748 "compatiblity \n");2747 puts("Warning: setting sector offset for DOS " 2748 "compatiblity"); 2749 2749 } 2750 2750 update_units(); … … 2782 2782 So try to be careful. This only works since 2.1.73. */ 2783 2783 2784 if ( strncmp("/dev/hd", device, 7))2784 if (!is_prefixed_with(device, "/dev/hd")) 2785 2785 return 0; 2786 2786 … … 2788 2788 procf = fopen_for_read(buf); 2789 2789 if (procf != NULL && fgets(buf, sizeof(buf), procf)) 2790 is_ide = ( !strncmp(buf, "cdrom", 5) ||2791 !strncmp(buf, "tape", 4));2790 is_ide = (is_prefixed_with(buf, "cdrom") || 2791 is_prefixed_with(buf, "tape")); 2792 2792 else 2793 2793 /* Now when this proc file does not exist, skip the … … 3025 3025 if (read_maybe_empty("Please enter the name of the " 3026 3026 "new boot file: ") == '\n') 3027 p rintf("Boot file unchanged\n");3027 puts("Boot file unchanged"); 3028 3028 else 3029 3029 sgi_set_bootfile(line_ptr); … … 3107 3107 case 'x': 3108 3108 if (LABEL_IS_SGI) { 3109 p rintf("\n\tSorry, no experts menu for SGI "3110 "partition tables available\n \n");3109 puts("\n\tSorry, no experts menu for SGI " 3110 "partition tables available\n"); 3111 3111 } else 3112 3112 xselect();
Note:
See TracChangeset
for help on using the changeset viewer.