X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Futils_devpath.c;h=472569e92df3927555cca843413ad366558bcec9;hb=89e09afdf6408d090617094e667bcca1b87dd86e;hp=94728730c452b496cd565949dfb11ce5949cc143;hpb=65f975655cde3777d4e9effd9635ef6fe20b3057;p=platform%2Fupstream%2Fcryptsetup.git diff --git a/lib/utils_devpath.c b/lib/utils_devpath.c index 9472873..472569e 100644 --- a/lib/utils_devpath.c +++ b/lib/utils_devpath.c @@ -30,6 +30,11 @@ #include #include "utils_dm.h" +/* These are DM helpers used only by this file */ +int dm_is_dm_device(int major, int minor); +int dm_is_dm_kernel_name(const char *name); +char *dm_device_path(const char *prefix, int major, int minor); + char *crypt_lookup_dev(const char *dev_id); int crypt_sysfs_get_rotational(int major, int minor, int *rotational); @@ -134,7 +139,7 @@ char *crypt_lookup_dev(const char *dev_id) if (snprintf(path, sizeof(path), "/sys/dev/block/%s", dev_id) < 0) return NULL; - len = readlink(path, link, sizeof(link)); + len = readlink(path, link, sizeof(link) - 1); if (len < 0) { /* Without /sys use old scan */ if (stat("/sys/dev/block", &st) < 0)