From f8214de959fe365274071e79c282bdfa3d743b23 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 11 Dec 2015 18:59:24 +0100 Subject: [PATCH] Adjust UUID printing in the log --- cmdline/mingw.c | 5 +++-- cmdline/unix.c | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 89ae82b7..83b26293 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -1537,9 +1537,10 @@ int windows_readlink(const char* file, char* buffer, size_t size) int devuuid(uint64_t device, char* uuid, size_t uuid_size) { /* just use the volume serial number returned in the device parameter */ - log_tag("uuid:windows:%08x:%u:\n", (unsigned)device, (unsigned)device); - snprintf(uuid, uuid_size, "%08x", (unsigned)device); + + log_tag("uuid:windows:%u:%s:\n", (unsigned)device, uuid); + return 0; } diff --git a/cmdline/unix.c b/cmdline/unix.c index 6f399a80..8611a112 100644 --- a/cmdline/unix.c +++ b/cmdline/unix.c @@ -107,12 +107,13 @@ static int devuuid_dev(uint64_t device, char* uuid, size_t uuid_size) continue; } - log_tag("uuid:dev:%s:%u:%u:\n", dd->d_name, major(st.st_rdev), minor(st.st_rdev)); - /* if it matches, we have the uuid */ if (S_ISBLK(st.st_mode) && st.st_rdev == (dev_t)device) { /* found */ pathcpy(uuid, uuid_size, dd->d_name); + + log_tag("uuid:dev:%u:%u:%s:\n", major(device), minor(device), uuid); + closedir(d); return 0; } @@ -151,10 +152,10 @@ static int devuuid_blkid(uint64_t device, char* uuid, size_t uuid_size) return -1; } - log_tag("uuid:blkid:%s:%u:%u:\n", uuidname, major(device), minor(device)); - pathcpy(uuid, uuid_size, uuidname); + log_tag("uuid:dev:%u:%u:%s:\n", major(device), minor(device), uuid); + free(devname); free(uuidname); return 0; @@ -175,8 +176,9 @@ int devuuid(uint64_t device, char* uuid, size_t uuid_size) return 0; #endif + log_tag("uuid:notfound:%u:%u:\n", major(device), minor(device)); + /* not supported */ - (void)device; (void)uuid; (void)uuid_size; return -1;