~psusi/ubuntu/raring/parted/resize

« back to all changes in this revision

Viewing changes to debian/patches/0004-parted-make-_partition_warn_busy-actually-a-warning-.patch

  • Committer: Phillip Susi
  • Date: 2013-02-24 17:29:22 UTC
  • Revision ID: psusi@ubuntu.com-20130224172922-uiesfa5wmnu8yqts
Backport online resize patches: 0001-parted-resizepart-command.patch,
0003-libparted-Add-support-for-BLKPG-ioctl-partition-resi.patch,
and 0004-parted-make-_partition_warn_busy-actually-a-warning.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 7ef73999b35294a8fd30f5af4eb6221a0ce62802 Mon Sep 17 00:00:00 2001
 
2
From: Phillip Susi <psusi@ubuntu.com>
 
3
Date: Wed, 30 Nov 2011 13:13:58 -0500
 
4
Subject: [PATCH 4/6] parted: make _partition_warn_busy actually a warning
 
5
 instead of an error
 
6
 
 
7
This function was throwing a PED_EXCEPTION_ERROR with only the
 
8
PED_EXCEPTION_CANCEL option.  Converted to a PED_EXCEPTION_WARNING
 
9
with the option to continue anyhow.
 
10
---
 
11
 parted/parted.c                                 |   19 +++++++++++--------
 
12
 tests/t1101-busy-partition.sh                   |    2 +-
 
13
 tests/t9041-undetected-in-use-16th-partition.sh |    4 ++--
 
14
 3 files changed, 14 insertions(+), 11 deletions(-)
 
15
 
 
16
Index: b/parted/parted.c
 
17
===================================================================
 
18
--- a/parted/parted.c
 
19
+++ b/parted/parted.c
 
20
@@ -224,14 +224,17 @@
 
21
 
 
22
         if (ped_partition_is_busy (part)) {
 
23
                 path = ped_partition_get_path (part);
 
24
-                ped_exception_throw (
 
25
-                        PED_EXCEPTION_ERROR,
 
26
-                        PED_EXCEPTION_CANCEL,
 
27
-                        _("Partition %s is being used. You must unmount it "
 
28
-                          "before you modify it with Parted."),
 
29
-                        path);
 
30
-                free (path);
 
31
-                return 0;
 
32
+                if (ped_exception_throw (
 
33
+                            PED_EXCEPTION_WARNING,
 
34
+                            PED_EXCEPTION_YES_NO,
 
35
+                            _("Partition %s is being used. Are you sure you " \
 
36
+                              "want to continue?"),
 
37
+                            path) != PED_EXCEPTION_YES)
 
38
+                {
 
39
+                        free (path);
 
40
+                        return 0;
 
41
+                }
 
42
+               free (path);
 
43
         }
 
44
         return 1;
 
45
 }