diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-04-28 17:52:09 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-04-28 17:52:09 +0200 |
commit | 3d6d12c6b17e6ea84112bd3a7aac19d8b614fc1c (patch) | |
tree | ebd8316652d92d2d780d4c08c8ff35522d82ed2f /extras | |
parent | 0e385feecc252b8803b5c4bf2dc501ab486d86f7 (diff) |
vol_id: fix logging from libvolume_id's log function
Diffstat (limited to 'extras')
-rw-r--r-- | extras/volume_id/lib/volume_id.c | 7 | ||||
-rw-r--r-- | extras/volume_id/vol_id.c | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/extras/volume_id/lib/volume_id.c b/extras/volume_id/lib/volume_id.c index 9f8e39b518..33fd890dfd 100644 --- a/extras/volume_id/lib/volume_id.c +++ b/extras/volume_id/lib/volume_id.c @@ -21,7 +21,6 @@ #include <unistd.h> #include <string.h> #include <errno.h> -#include <errno.h> #include <ctype.h> #include <fcntl.h> #include <sys/stat.h> @@ -42,6 +41,9 @@ int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size) if (id == NULL) return -EINVAL; + info("probing at offset 0x%llx, size 0x%llx", + (unsigned long long) off, (unsigned long long) size); + /* probe for raid first, because fs probes may be successful on raid members */ if (size) { if (volume_id_probe_linux_raid(id, off, size) == 0) @@ -91,6 +93,9 @@ int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size if (id == NULL) return -EINVAL; + info("probing at offset 0x%llx, size 0x%llx", + (unsigned long long) off, (unsigned long long) size); + if (volume_id_probe_luks(id, off) == 0) goto found; diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c index 2274550c19..dcf56d87e9 100644 --- a/extras/volume_id/vol_id.c +++ b/extras/volume_id/vol_id.c @@ -63,10 +63,13 @@ void log_message(int priority, const char *format, ...) static void vid_log(int priority, const char *file, int line, const char *format, ...) { #ifdef USE_LOG + char log_str[1024]; va_list args; va_start(args, format); - log_message(priority, format, args); + vsnprintf(log_str, sizeof(log_str), format, args); + log_str[sizeof(log_str)-1] = '\0'; + log_message(priority, "%s:%i %s", file, line, log_str); va_end(args); #endif return; |