]> sourceware.org Git - lvm2.git/commitdiff
Add error path stack traces
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 30 Nov 2010 22:32:44 +0000 (22:32 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 30 Nov 2010 22:32:44 +0000 (22:32 +0000)
Check for errors from dm_task_set_name() and dm_task_run().
Add stack traces for error paths.
Return 0 if some error is found.

libdm/ioctl/libdm-iface.c

index 8c0115a900f7043d2d2ca16198f25a53bda7c3f3..3bc19096b9c060456f10ef255d89840ff32cf67f 100644 (file)
@@ -1594,8 +1594,15 @@ static int _process_mapper_dir(struct dm_task *dmt)
                    !strcmp(dirent->d_name, "..") ||
                    !strcmp(dirent->d_name, "control"))
                        continue;
-               dm_task_set_name(dmt, dirent->d_name);
-               dm_task_run(dmt);
+               if (!dm_task_set_name(dmt, dirent->d_name)) {
+                       r = 0;
+                       stack;
+                       continue; /* try next name */
+               }
+               if (!dm_task_run(dmt)) {
+                       r = 0;
+                       stack;  /* keep going */
+               }
        }
 
        if (closedir(d))
This page took 0.040181 seconds and 5 git commands to generate.