summaryrefslogtreecommitdiffstats
path: root/libblkid/src/verify.c
diff options
context:
space:
mode:
authorKarel Zak2013-04-08 18:22:13 +0200
committerKarel Zak2013-04-08 18:22:13 +0200
commit0540ea544d4b459bc148d29645225190b76ca8b7 (patch)
treef0902ec8cb04f8148ffd87170c2f1bdd7534564e /libblkid/src/verify.c
parentbash-completion: Symlink runuser symlink to su so it gets loaded on demand. (diff)
downloadkernel-qcow2-util-linux-0540ea544d4b459bc148d29645225190b76ca8b7.tar.gz
kernel-qcow2-util-linux-0540ea544d4b459bc148d29645225190b76ca8b7.tar.xz
kernel-qcow2-util-linux-0540ea544d4b459bc148d29645225190b76ca8b7.zip
libblkid: clean up DBG()
- use stderr only - use BLKID_ prefix for debug masks - don't use \n in in messages and don't use printf(), but use generic blkid_debug(). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/verify.c')
-rw-r--r--libblkid/src/verify.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c
index bd756e7a7..1c0ca0f7d 100644
--- a/libblkid/src/verify.c
+++ b/libblkid/src/verify.c
@@ -71,14 +71,13 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
diff = now - dev->bid_time;
if (stat(dev->bid_name, &st) < 0) {
- DBG(DEBUG_PROBE,
- printf("blkid_verify: error %m (%d) while "
- "trying to stat %s\n", errno,
+ DBG(PROBE, blkid_debug("blkid_verify: error %m (%d) while "
+ "trying to stat %s", errno,
dev->bid_name));
open_err:
if ((errno == EPERM) || (errno == EACCES) || (errno == ENOENT)) {
/* We don't have read permission, just return cache data. */
- DBG(DEBUG_PROBE, printf("returning unverified data for %s\n",
+ DBG(PROBE, blkid_debug("returning unverified data for %s",
dev->bid_name));
return dev;
}
@@ -100,15 +99,13 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
return dev;
#ifndef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
- DBG(DEBUG_PROBE,
- printf("need to revalidate %s (cache time %lu, stat time %lu,\n\t"
- "time since last check %lu)\n",
+ DBG(PROBE, blkid_debug("need to revalidate %s (cache time %lu, stat time %lu,\t"
+ "time since last check %lu)",
dev->bid_name, (unsigned long)dev->bid_time,
(unsigned long)st.st_mtime, (unsigned long)diff));
#else
- DBG(DEBUG_PROBE,
- printf("need to revalidate %s (cache time %lu.%lu, stat time %lu.%lu,\n\t"
- "time since last check %lu)\n",
+ DBG(PROBE, blkid_debug("need to revalidate %s (cache time %lu.%lu, stat time %lu.%lu,\t"
+ "time since last check %lu)",
dev->bid_name,
(unsigned long)dev->bid_time, (unsigned long)dev->bid_utime,
(unsigned long)st.st_mtime, (unsigned long)st.st_mtim.tv_nsec / 1000,
@@ -125,8 +122,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
fd = open(dev->bid_name, O_RDONLY|O_CLOEXEC);
if (fd < 0) {
- DBG(DEBUG_PROBE, printf("blkid_verify: error %m (%d) while "
- "opening %s\n", errno,
+ DBG(PROBE, blkid_debug("blkid_verify: error %m (%d) while "
+ "opening %s", errno,
dev->bid_name));
goto open_err;
}
@@ -177,7 +174,7 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
blkid_probe_to_tags(cache->probe, dev);
- DBG(DEBUG_PROBE, printf("%s: devno 0x%04llx, type %s\n",
+ DBG(PROBE, blkid_debug("%s: devno 0x%04llx, type %s",
dev->bid_name, (long long)st.st_rdev, dev->bid_type));
}