diff options
author | Phillip Susi <psusi@ubuntu.com> | 2011-11-30 13:13:58 -0500 |
---|---|---|
committer | Phillip Susi <psusi@ubuntu.com> | 2014-06-15 15:16:30 -0400 |
commit | f46146a15bf45478569c1d364661d3d54f8e3a1a (patch) | |
tree | 7d4863d838cad9a6dd2a72c676584330f3c67bd4 /parted | |
parent | f09ca967a0bc443b869a6fad5b5ffe8e95c3fe9a (diff) | |
download | parted-f46146a15bf45478569c1d364661d3d54f8e3a1a.tar.gz |
parted: make _partition_warn_busy actually a warning instead of an error
This function was throwing a PED_EXCEPTION_ERROR with only the
PED_EXCEPTION_CANCEL option. Converted to a PED_EXCEPTION_WARNING
with the option to continue anyhow.
Diffstat (limited to 'parted')
-rw-r--r-- | parted/parted.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/parted/parted.c b/parted/parted.c index a36ca28..ec9e04e 100644 --- a/parted/parted.c +++ b/parted/parted.c @@ -224,14 +224,17 @@ _partition_warn_busy (PedPartition* part) if (ped_partition_is_busy (part)) { path = ped_partition_get_path (part); - ped_exception_throw ( - PED_EXCEPTION_ERROR, - PED_EXCEPTION_CANCEL, - _("Partition %s is being used. You must unmount it " - "before you modify it with Parted."), - path); + if (ped_exception_throw ( + PED_EXCEPTION_WARNING, + PED_EXCEPTION_YES_NO, + _("Partition %s is being used. Are you sure you " \ + "want to continue?"), + path) != PED_EXCEPTION_YES) + { + free (path); + return 0; + } free (path); - return 0; } return 1; } |