Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/util-linux/fdisk.c

    r3232 r3621  
    11031103    if (!g_cylinders)
    11041104        printf(" cylinders");
    1105     printf(
    11061105#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
    11101110    return 1;
    11111111}
     
    11511151    p = pex->part_table;
    11521152    if (!get_start_sect(p)) {
    1153         printf("Bad offset in primary extended partition\n");
     1153        puts("Bad offset in primary extended partition");
    11541154        return;
    11551155    }
     
    14511451            return 0;
    14521452        }
    1453         printf("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.");
    14551455    }
    14561456#endif
     
    14621462    if (!valid_part_table_flag(MBRbuffer)) {
    14631463        if (what == OPEN_MAIN) {
    1464             printf("Device contains neither a valid DOS "
    1465                   "partition table, nor Sun, SGI, OSF or GPT "
    1466                   "disklabel\n");
     1464            puts("Device contains neither a valid DOS "
     1465                 "partition table, nor Sun, SGI, OSF or GPT "
     1466                 "disklabel");
    14671467#ifdef __sparc__
    14681468            IF_FEATURE_SUN_LABEL(create_sunlabel();)
     
    15971597        if (value >= low && value <= high)
    15981598            break;
    1599         printf("Value is out of range\n");
     1599        puts("Value is out of range");
    16001600    }
    16011601    return value;
     
    16421642        return pno;
    16431643    }
    1644     printf("No partition is defined yet!\n");
     1644    puts("No partition is defined yet!");
    16451645    return -1;
    16461646
     
    16691669        return pno;
    16701670    }
    1671     printf("All primary partitions have been defined already!\n");
     1671    puts("All primary partitions have been defined already!");
    16721672    return -1;
    16731673
     
    17041704    if (dos_compatible_flag) {
    17051705        sector_offset = g_sectors;
    1706         printf("DOS Compatibility flag is set\n");
     1706        printf("DOS Compatibility flag is %sset\n", "");
    17071707    } else {
    17081708        sector_offset = 1;
    1709         printf("DOS Compatibility flag is not set\n");
     1709        printf("DOS Compatibility flag is %sset\n", "not ");
    17101710    }
    17111711}
     
    18141814
    18151815        if (!sys && !LABEL_IS_SGI && !LABEL_IS_SUN) {
    1816             printf("Type 0 means free space to many systems\n"
    1817                    "(but not to Linux). Having partitions of\n"
    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.");
    18191819            /* break; */
    18201820        }
     
    18221822        if (!LABEL_IS_SUN && !LABEL_IS_SGI) {
    18231823            if (IS_EXTENDED(sys) != IS_EXTENDED(p->sys_ind)) {
    1824                 printf("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");
    18261826                break;
    18271827            }
     
    18311831#if ENABLE_FEATURE_SUN_LABEL
    18321832            if (LABEL_IS_SUN && i == 2 && sys != SUN_WHOLE_DISK)
    1833                 printf("Consider leaving partition 3 "
    1834                        "as Whole disk (5),\n"
    1835                        "as SunOS/Solaris expects it and "
    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");
    18371837#endif
    18381838#if ENABLE_FEATURE_SGI_LABEL
     
    18431843                )
    18441844            ) {
    1845                 printf("Consider leaving partition 9 "
    1846                        "as volume header (0),\nand "
    1847                        "partition 11 as entire volume (6)"
    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");
    18491849            }
    18501850#endif
     
    20682068
    20692069    if (!wrong_p_order(NULL)) {
    2070         printf("Ordering is already correct\n\n");
     2070        puts("Ordering is already correct\n");
    20712071        return;
    20722072    }
     
    20962096        fix_chain_of_logicals();
    20972097
    2098     printf("Done.\n");
     2098    puts("Done");
    20992099}
    21002100#endif
     
    21792179    if (LABEL_IS_DOS && wrong_p_order(NULL)) {
    21802180        /* FIXME */
    2181         printf("\nPartition table entries are not in disk order\n");
     2181        puts("\nPartition table entries are not in disk order");
    21822182    }
    21832183}
     
    21932193    printf("\nDisk %s: %u heads, %u sectors, %u cylinders\n\n",
    21942194        disk_device, g_heads, g_sectors, g_cylinders);
    2195     printf("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");
    21962196    for (i = 0; i < g_partitions; i++) {
    21972197        pe = &ptes[i];
     
    24202420    }
    24212421    if (start > limit) {
    2422         printf("No free sectors available\n");
     2422        puts("No free sectors available");
    24232423        if (n > 4)
    24242424            g_partitions--;
     
    24912491    }
    24922492    if (LABEL_IS_AIX) {
    2493         printf("Sorry - this fdisk cannot handle AIX disk labels.\n"
     2493        puts("Sorry - this fdisk cannot handle AIX disk labels.\n"
    24942494"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.");
    24962496        return;
    24972497    }
     
    25012501
    25022502    if (!free_primary && g_partitions >= MAXIMUM_PARTS) {
    2503         printf("The maximum number of partitions has been created\n");
     2503        puts("The maximum number of partitions has been created");
    25042504        return;
    25052505    }
     
    25092509            add_logical();
    25102510        else
    2511             printf("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");
    25132513    } else {
    25142514        char c, line[80];
     
    25482548    int i;
    25492549
    2550     printf("Calling ioctl() to re-read partition table\n");
     2550    puts("Calling ioctl() to re-read partition table");
    25512551    sync();
    25522552    /* Users with slow external USB disks on a 320MHz ARM system (year 2011)
     
    25592559#if 0
    25602560    if (dos_changed)
    2561         printf(
     2561        puts(
    25622562        "\nWARNING: If you have created or modified any DOS 6.x\n"
    25632563        "partitions, please see the fdisk manual page for additional\n"
    2564         "information\n");
     2564        "information");
    25652565#endif
    25662566
     
    25902590    }
    25912591    else if (LABEL_IS_SGI) {
    2592         /* no test on change? the printf below might be mistaken */
     2592        /* no test on change? the "altered" msg below might be mistaken */
    25932593        sgi_write_table();
    25942594    }
     
    26022602    }
    26032603
    2604     printf("The partition table has been altered.\n");
     2604    puts("The partition table has been altered.");
    26052605    reread_partition_table(1);
    26062606}
     
    27452745            if (dos_compatible_flag) {
    27462746                sector_offset = g_sectors;
    2747                 printf("Warning: setting sector offset for DOS "
    2748                     "compatiblity\n");
     2747                puts("Warning: setting sector offset for DOS "
     2748                    "compatiblity");
    27492749            }
    27502750            update_units();
     
    27822782       So try to be careful. This only works since 2.1.73. */
    27832783
    2784     if (strncmp("/dev/hd", device, 7))
     2784    if (!is_prefixed_with(device, "/dev/hd"))
    27852785        return 0;
    27862786
     
    27882788    procf = fopen_for_read(buf);
    27892789    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"));
    27922792    else
    27932793        /* Now when this proc file does not exist, skip the
     
    30253025                if (read_maybe_empty("Please enter the name of the "
    30263026                        "new boot file: ") == '\n')
    3027                     printf("Boot file unchanged\n");
     3027                    puts("Boot file unchanged");
    30283028                else
    30293029                    sgi_set_bootfile(line_ptr);
     
    31073107        case 'x':
    31083108            if (LABEL_IS_SGI) {
    3109                 printf("\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");
    31113111            } else
    31123112                xselect();
Note: See TracChangeset for help on using the changeset viewer.