1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

missing dm_snprintf

This commit is contained in:
Alasdair Kergon 2009-09-25 19:06:05 +00:00
parent 536f0e0881
commit 2b33edfcf7

View File

@ -261,7 +261,11 @@ int dm_task_set_name(struct dm_task *dmt, const char *name)
* under /dev/mapper, use that name directly. Otherwise call
* _find_dm_name_of_device() to scan _dm_dir for a match.
*/
snprintf(path, sizeof(path), "%s/%s", _dm_dir, pos + 1);
if (dm_snprintf(path, sizeof(path), "%s/%s", _dm_dir,
pos + 1) == -1) {
log_error("Couldn't create path for %s", pos + 1);
return 0;
}
if (!stat(path, &st2) && (st1.st_rdev == st2.st_rdev))
name = pos + 1;