From: Zdenek Kabelac Date: Tue, 30 Nov 2010 22:32:44 +0000 (+0000) Subject: Add error path stack traces X-Git-Tag: v2_02_91~1320 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=5b8abb1240418a1cdfb45b83aa90babefcd32032;p=lvm2.git Add error path stack traces 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. --- diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index 8c0115a90..3bc19096b 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -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))