]> git.pld-linux.org Git - packages/parted.git/blob - 0071-parted-check-the-name-of-partition-first-when-to-nam.patch
- rel 4; tons of patches from FC
[packages/parted.git] / 0071-parted-check-the-name-of-partition-first-when-to-nam.patch
1 From 1a891f6d352d47a6a9422083bbb38a2c4c4e901b Mon Sep 17 00:00:00 2001
2 From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
3 Date: Fri, 24 Mar 2017 03:11:08 +0100
4 Subject: [PATCH 71/75] parted: check the name of partition first when to name
5  a partition
6
7 The previous function works well for the labels supporting naming
8 partition, but not for these which don't. If the disk label does not
9 support partition naming, two exceptions will be raised. Even after the first
10 error indicates it does not support name, parted yet asks user for
11 name in iteractive mode.
12
13 First check if the disk label supports partition naming and if it
14 does, it will continue; otherwise, it will stop and raise an
15 exception.
16
17 Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
18 Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
19 ---
20  parted/parted.c | 7 +++++++
21  1 file changed, 7 insertions(+)
22
23 diff --git a/parted/parted.c b/parted/parted.c
24 index a7fcd3b..d2e1f24 100644
25 --- a/parted/parted.c
26 +++ b/parted/parted.c
27 @@ -870,6 +870,13 @@ do_name (PedDevice** dev, PedDisk** diskp)
28          if (!*diskp)
29                  goto error;
30  
31 +        if (!ped_disk_type_check_feature((*diskp)->type, PED_DISK_TYPE_PARTITION_NAME)) {
32 +                ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
33 +                                     _("%s disk labels do not support partition name."),
34 +                                    (*diskp)->type->name);
35 +                goto error;
36 +        }
37 +
38          if (!command_line_get_partition (_("Partition number?"), *diskp, &part))
39                  goto error;
40  
41 -- 
42 2.9.3
43
This page took 0.045011 seconds and 3 git commands to generate.