]> TLD Linux GIT Repositories - packages/lvm2.git/blob - device-mapper-dmsetup-deps-export.patch
- updated to 2.02.140
[packages/lvm2.git] / device-mapper-dmsetup-deps-export.patch
1 ---
2  tools/dmsetup.c |   23 +++++++++++++++++++++++
3  1 file changed, 23 insertions(+)
4
5 Index: LVM2.2.02.98/tools/dmsetup.c
6 ===================================================================
7 --- LVM2.2.02.98.orig/tools/dmsetup.c
8 +++ LVM2.2.02.98/tools/dmsetup.c
9 @@ -1717,10 +1717,11 @@ static int _export(CMD_ARGS)
10         char *target_type = NULL;
11         char *params;
12         const char *name = NULL;
13         const char *uuid = NULL;
14         struct dm_info info;
15 +       struct dm_deps *deps;
16  
17         if (names)
18                 name = names->name;
19         else if (argc == 2)
20                 name = argv[1];
21 @@ -1786,10 +1787,32 @@ static int _export(CMD_ARGS)
22                                 printf(",%s", target_type);
23                 }
24                 printf("\n");
25         }
26  
27 +       dm_task_destroy(dmt);
28 +
29 +       if (!(dmt = dm_task_create(DM_DEVICE_DEPS)))
30 +               goto out;
31 +
32 +       name = NULL;
33 +       if (names)
34 +               name = names->name;
35 +       else if (argc == 2)
36 +               name = argv[1];
37 +
38 +       if (!_set_task_device(dmt, name, 0))
39 +               goto out;
40 +
41 +       if (!dm_task_run(dmt))
42 +               goto out;
43 +
44 +       if (!(deps = dm_task_get_deps(dmt)))
45 +               goto out;
46 +
47 +       printf("DM_DEPS=%d\n", deps->count);
48 +
49         r = 1;
50        out:
51         if (dmt)
52                 dm_task_destroy(dmt);
53         return r;