/*
parted - a frontend to libparted
- Copyright (C) 1999-2003, 2005-2008 Free Software Foundation, Inc.
+ Copyright (C) 1999-2003, 2005-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
do_mklabel (PedDevice** dev)
{
PedDisk* disk;
- const PedDiskType* type = ped_disk_probe (*dev);
+ const PedDiskType* type = NULL;
ped_exception_fetch_all ();
disk = ped_disk_new (*dev);
if (!disk) ped_exception_catch ();
ped_exception_leave_all ();
+ if (!command_line_get_disk_type (_("New disk label type?"), &type))
+ goto error;
+
if (disk) {
if (!_disk_warn_busy (disk))
goto error_destroy_disk;
ped_disk_destroy (disk);
}
- if (!command_line_get_disk_type (_("New disk label type?"), &type))
- goto error;
-
disk = ped_disk_new_fresh (*dev, type);
if (!disk)
goto error;
'check its "interactive" output' \
'compare out exp 1>&2'
-test_expect_success 'create interactive input' 'printf "y\n\n" > in'
+test_expect_success 'create interactive input' 'printf "y\n" > in'
# Now that there's a label, rerunning the same command is interactive.
test_expect_success \
cat <<EOF >> exp || fail=1
Warning: The existing disk label on DEVICE will be destroyed and all\
data on this disk will be lost. Do you want to continue?
-parted: invalid token: msdos
Yes/No? y
-New disk label type? [msdos]?
EOF
test_expect_success \
'create expected output file' \